You can do that by making AsSomeClass
an extension method on IEnumerable<EntityClass>
(or on IQueryable<EntityClass>
as well, but in this instance that does not buy you anything), but please don't.
.Select(ConversionFunction)
is totally clear on the reader; .AsSomeClass()
is rather opaque: it could be doing pretty much anything. Could you tell if for example it casts the contents of sequence or if it projects them, or even if it changes the type of the sequence itself?