-4

LINQ to SQL でこの SQL クエリに相当するものは何ですか?

select *
from Leads, LeadCustomAttributes LCA  
where Leads.LeadID = LCA.LeadID  
&& LCA.AttributeID in ('2','4','2')  
4

2 に答える 2

1
var query =
    from lead in db.Leads
    from lca in db.LeadCustomAttributes
    where lead.LeadID == lca.LeadID
    where new[] { "2", "4" }.Contains(lca.AttributeID)
    select new { lead, lca };
于 2013-03-03T05:32:32.080 に答える
0
int[] ids = { 2, 4, 2};

var result = from leads in context.Leads
             join LCA in context.LeadCustomAttributes
             ON leads.LeadID = LCA.LeadID
             Where ids.Contains(ids.ContainsLeadCustomAttributes)
             select leads;
于 2013-03-03T05:38:09.830 に答える