Some thing about Lambda expression and NHB

Source: Internet
Author: User

LINQ experience (17) -- the dynamic query example of the LINQ to SQL statement:

Code

Using (Employeedbdatacontext DB =   New Employeedbdatacontext ())
{

VaR L = DB. vw_employees;
Parameterexpression Param = Expression. parameter ( Typeof (Vw_employee ), " P " );
Expression left = Expression. Property (Param, Typeof (Vw_employee). getproperty ( " Emplid " ));
Expression right = Expression. Constant (EMP. emplid );
Expression Filter = Expression. Equal (left, right );
Expression Pred = Expression. Lambda (filter, Param );
Expression expr = Expression. Call ( Typeof (Queryable ), " Where " ,
New Type [] { Typeof (Vw_employee )},
Expression. Constant (L), Pred );
Iqueryable < Vw_employee > Query = DB. vw_employees.asqueryable (). provider. createquery < Vw_employee > (Expr );
Return Query. tolist ();
}

Lambda: http://www.cnblogs.com/killuakun/archive/2008/08/03/1259389.html http://www.cnblogs.com/terrylee/archive/2008/08/01/custom-linq-provider-part-1-expression-tree.html http://www.cnblogs.com/ninputer/archive/2009/08/28/expression_tree1.html http://www.cnblogs.com/126/archive/2007/08/15/857193.html Lambda Expression Tree: build your own LINQ provider (on): Expression Tree reveal how to build your own LINQ provider (in ): iqueryable and iqueryprovider LINQ to SQL advanced series (6) How to Use object to dynamically query and save log Expression Tree (I) ==> NHB

Http://www.kontac.net/site/

Http://www.cnblogs.com/lyj/archive/2008/11/10/1330542.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.