I often want just the total count(or other aggregate) of a selection, typically when cruising through some data with LinqPad for example this query that returns the number of public enums in the core lib.
"".GetType().Assembly.GetTypes().Where(t => t.IsPublic && t.IsEnum).Count()
I know that I could do something like this:
(from t in "".GetType().Assembly.GetTypes()
where t.IsEnum && t.IsPublic select t.Name).Count()
but maybe because of too many years in T-SQL, I find the "select t.Name" a bit off-putting.
Is there another way to get this Count without stating the "select t.Name"