join子句中的表达式之一的类型不正确。类型推断失败

时间:2018-10-17 07:51:46

标签: c# linq

在计划加入两个以上的表时出现错误。

public List<EmailContent> RABsalesHeadStatusRejectBody(string EnqId)
{
    List<EmailContent> E_mail = new List<EmailContent>();
    var join_Body = new EmailContent();
    var line = Environment.NewLine;

    if (EnqId != null)
    {
        var x = 
            from n in db.EMS_ENQUIRYREGISTRATION_MASTER
            join _categeory in db.EMS_CATEGORY_MASTER on n.CATEGORY_ID equals _categeory.CATEGORY_ID
            join sal in db.EMS_USER_MASTER on n.Saleshead equals sal.USER_ID 
            where n.ENQUIRY_CODE == EnqId
            select new RegisterationMaster
            {
                CATEGORY_ID = _categeory.CATEGORY_ID,
                RECEIVED_BY = n.RECEIVED_BY
            };
    }

}

请建议我如何加入两个桌子

0 个答案:

没有答案