Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you give the resulting set a name when calling Linqpad's .Dump() method on a List<>?

Tags:

linq

linqpad

Say I make the following query expression:

var clients =  
    (from c in Clients  
     where (c.Age == 20)  
     select new { c.FirstName, c.LastName }  
    ).ToList();

Calling clients.Dump() in Linqpad shows the following in the Results Panel:

List<> (5 items)

Is there a way to rename the set's header, to let's say 'clients', instead of 'List<> (5 items)'?

like image 942
Jaimie Knox Avatar asked May 06 '16 15:05

Jaimie Knox


1 Answers

The header indicates the type, so you can't rename it without changing the collection type. Instead, you would normally call .Dump with a heading:

clients.Dump ("clients")

and then you get the list with a heading of 'clients'.

like image 104
Joe Albahari Avatar answered Oct 11 '22 12:10

Joe Albahari