Próba wykonania polecenia WHERE IN: Nieprawidłowy warunek „gdzie”. Członek encji wywołuje niepoprawną właściwość lub metodę

Próbuję uzyskać listę przypadków, których identyfikator konta znajduje się na poprzedniej liście.

Błąd występuje w ostatnim wierszu następujących elementów:

// Gets the list of permissions for the current contact
var perms = ServiceContext.GetCaseAccessByContact(Contact).Cast<Adx_caseaccess>();

// Get the list of account IDs from the permissions list
var customerIDs = perms.Select(p => p.adx_accountid).Distinct();

// Get the list of cases that belong to any account whose ID is in the `customerID` list
var openCases = (from c in ServiceContext.IncidentSet where customerIDs.Contains(c.AccountId) select c).ToList();

Nie jestem pewien, o czym mówi „nieprawidłowa własność”. Kod się kompiluje, po prostu dostaję błąd w czasie wykonywania.

questionAnswers(1)

yourAnswerToTheQuestion