Just out of curiosity:
Many LINQ extension methods exist as both generic and non-generic variants, for example Any
and Any<>
, Where
and Where<>
etc. Writing my queries I usually use the non-generic variants and it works fine.
What would be the cases when one has to use generic methods?
--- edit ---
P.S.: I am aware of the fact that internally only generic methods are called and the compiler tries to resolve the content of the generic brackets <>
during compilation.
My question is rather what are the cases then one has to provide the type explicitly and not to rely on the compiler's intuition?