Home > Net >  About the where method to use
About the where method to use

Time:05-06

1, the public static IEnumerable Where (this IEnumerable The source, Func Predicate);
2, the public static IEnumerable Where (this IEnumerable The source, Func Predicate);
There are several questions:
1, Where method parameter is Function Authorization of type of the delegate is the predicate? Is this mean?
2, read a book on the sample, as follows:
Int sum1=nums. Where (n=& gt; N % 4==0). The Sum ();
Behind the nums operator, belong to call the method that collection objects,
Sometimes don't use the dot operator, for example:
Var result=the from b in ds. Tables [r]. "tb_Bookinfo AsEnumerable () where b. ield (" b_pub_date "). The Month==3
Aelect new
{
.

}

CodePudding user response:

In the second case, usage such as SQL statements, rather than function,

CodePudding user response:

The where (query expression)

Except for generic constraint, where also commonly used in the query expression,
  •  Tags:  
  • LINQ
  • Related