The Select
and Where
methods are available in Linq. What should every developer know about these two methods? For example: when to use one over th
In case of Select it you can map to an IEnumerable of a new structure.
A.Select(x=>new X{UID=x.uid, UNAME=x.uname})
//input as [IEnumerable<A>] --------> return output as [IEnumerable<X> ]
Where() works as an filter to the IEnumerable, it will return the result on the basis of the where clause.
A.Where(x=>x.uid!=0) //input as [IEnumerable<A>] --------> return output as [IEnumerable<A> ]