Please see below my LINQ query :
var customertList = (from c in context.ContactSet
join co in context.ConnectionSet on c.ContactId.Value equals co.Record1Id.Id
join ac in context.AccountSet on co.Record2Id.Id equals ac.AccountId.Value
join cr in context.ConnectionRoleSet on co.Record2RoleId.Id equals cr.ConnectionRoleId.Value
where c.StatusCode.Value == (int)contact_statuscode.Active
from subca in context.CampaignSet.Where(camp => ac.AccountId.Value == camp.exch_CampaignAccount.Id).DefaultIfEmpty()
select new HCRCustomerRequest
{
FullName = c.FullName,
CustomerId = c.ContactId.Value,
CampaignId = subca.CampaignId.Value
}).ToList()
Above query giving me error : A 'SelectMany' operation must be preceeded by a 'Where' operation that filters by an entity ID.
Please suggest what changes needed in the query to run it successfully.
Thanks
*This post is locked for comments
I have the same question (0)