web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

An entity member is invoking an invalid property or method in LINQ

(0) ShareShare
ReportReport
Posted on by 115

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

I have the same question (0)
  • Sarah Daniel Beshay Profile Picture
    on at

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 171 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 83

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans