EF的join用法

var customers = DB.Customer.Join(DB.Commission, cst => cst.CommissionId,
                                        com => com.CommissionId, (cst, com) => new Customer()
                                        {
                                            CommissionId = com.CommissionId,
                                            CustomerId = cst.CustomerId,
                                            CustomerName = cst.CustomerName,
                                            ERPCustomerNo = cst.ERPCustomerNo,
                                            UserId = cst.UserId
                                        }).ToList();

posted @ 2015-12-09 18:54  甜菜波波  阅读(2014)  评论(0编辑  收藏  举报