Note that there are some explanatory texts on larger screens.

plurals
  1. POLinq join static guid
    primarykey
    data
    text
    <pre><code>select ca.Name,l.ListName,ci.EntityId,ci.EntityType,c.FullName from List l inner join Contact c on c.ContactId = 'D48457AB-C0B5-E211-838F-000C29DFF60A' inner join CampaignItem ci on ci.EntityId = l.ListId inner join Campaign ca on ca.CampaignId = ci.CampaignId where l.CreatedFromCode = 2 and ci.EntityType = 4300 </code></pre> <p>How can I join static guid in Linq?</p> <p>Here is my linq statement . I get excepetion when I run this query. How Can I join static Guid into my query?</p> <pre><code>var list = (from li in context.ListSet join lm in context.ListMemberSet on li.ListId.Value equals lm.ListId.Id join c in context.ContactSet on lm.EntityId.Id equals on new Guid("D48457AB-C0B5-E211-838F-000C29DFF60A") join ci in context.CampaignItemSet on li.ListId.Value equals ci.EntityId join cam in context.CampaignSet on ci.CampaignId.Id equals cam.CampaignId.Value select new { ListId = li.ListId, ListType = li.Type, MemberType = li.CreatedFromCode, EntityType = lm.EntityType, EntityId = lm.EntityId, ContactNumber = c.trd_CustomerNumber, CampaignRelatedEntity = ci.EntityType, CampaignName = cam.Name == null ? string.Empty : cam.Name, CampaignCode = cam.CodeName == null ? string.Empty : cam.CodeName, Objective = cam.Objective == null ? string.Empty : cam.Objective, CampaignType = cam.TypeCode == null ? string.Empty : ((FinansCrm.BusinessLibrary.Utils.XrmHelper.OptionSetInfo)XrmHelper.GetOption(service, Campaign.EntityLogicalName, "typecode", cam.TypeCode.Value)).Label, BeginDate = cam.ActualStart == null ? string.Empty : cam.ActualStart.Value.ToString(), EndDate = cam.ActualEnd == null ? string.Empty : cam.ActualEnd.Value.ToString(), CampaignId = cam.CampaignId.Value }).ToList() .Where(p =&gt; p.ListType.Value.Equals(false) &amp;&amp; p.EntityType.Equals(Contact.EntityLogicalName) &amp;&amp; p.MemberType.Value.Equals(Contact.EntityTypeCode) &amp;&amp; p.ContactNumber.Equals(id) &amp;&amp; p.CampaignRelatedEntity.Equals(List.EntityLogicalName)) .ToList(); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload