Linq Linq - Linq ( ).
, QueryBuilder, , .
, Linq , Linq "", ( SQL Linq-To-SQL, Linq-For-Objects).
, , Linq, , , . , Linq , - .
. 65 :
Dim qry = From customer in DataContext.Customers
qry = qry.Where( Function (c as Customer) c.Name="Jim" )
qry = qry.Where( Function (c as Customer) c.Age < 65 )
qry = qry.OrderByDescending( Function (c as Customer) c.Age )
qry = qry.Take(1)
Dim oldJim as Customer = qry.FirstOrDefault()
A FirstOrDefault method, such as using ToArray or For Each, disables the enumerator and thus processes the request.
Hope this helps!
source
share