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

Let's 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 () on Linqpad shows the following in the results pane:

List <> (5 items)

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

+4
source share
1 answer

The header indicates the type, so you cannot rename it without changing the type of the collection. Instead, you usually call .Dump with the header:

clients.Dump ("clients")

and then you will get a list with the heading "customers".

+6
source

All Articles