
Hi,
I am trying to fetch a list of records related to a list of another entity records through LINQ.
My Code:
List<ct_stakeholderpercentage> stakeHolderPercentage = (from shp in svcContext.CreateQuery<ct_stakeholderpercentage>()
where shp.ct_Stakeholder != null && array.Contains(shp.ct_Stakeholder.Id)
select shp).ToList();
where 'array' contains an array of GUIDs.
I am getting an error saying 'Invalid where condition. An entity member is trying to invoke an invalid property or method'.
Help me sort out this issue.
Thanks
Hi ICAEW UK,
Thank you for posting your question on communities.
Please try removing one of the conditions to identify which of them is throwing the error.
If the error comes from the code "array.Contains(shp.ct_Stakeholder.Id), can you also elaborate more on how you define the array variable ?
Thanks in advance