how VAR is determined against many options?
- by Royi Namir
i have this code :
IEnumerable<string> q = customers /*EF entity*/
.Select (c => c.Name.ToUpper())
.OrderBy (n => n)
To select entity, ObjectContext actually create ObjectQuery, which
implement IQueryable. The object return from ObjectQuery, is not
normal object, but EntityObject
but what if i write : ( notice the var)
var q = customers /*EF entity*/
.Select (c => c.Name.ToUpper())
.OrderBy (n => n)
it can be determined both to ienumerable or iqueryable :
because ObjectQuery Also implements IEnumerable...
i dont know if there's any specific info which tell the compiler "use A and not B. A is more specific..." ( there must be...i just cant find it)
any help ? how will it know to use A || B ?