example:
代码
            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 :
 
 
 
   
 

相关文章:

  • 2022-02-02
  • 2022-12-23
  • 2021-05-16
  • 2021-09-03
  • 2021-10-30
  • 2021-11-16
  • 2021-07-08
  • 2021-06-20
猜你喜欢
  • 2022-12-23
  • 2022-01-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-31
相关资源
相似解决方案