This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
hi, I have an expression as follow:
person => person.PersonRoles.Any(pr=>pr.PersonRoleOrganisations.Any(o => o.TerminationDate == null && o.OrganisationId == 2))); and I am getting an error: Exception Details: System.NotSupportedException: Cannot use PersonRoleOrganisations[TerminationDate = True] as part of a logical expression in an Any or All expression This works if i just go:
Is this because && is not supported in Any (though i did read on the latest release that this is supported). Help! Thanks. |
|
|
We do support && in Any, but we don't currently support it within a nested Any-Any chain when that chain is inside a Where (or Select, OrderBy, etc.) clause. I will take a look at adding this but I can't make any promises. |
|
|
Thanks Ivan. How do you suggest I write that query above without that? Is it possible? thanks |
|
|
I don't think it can be done in LINQ at the moment. I think it can be done in the core API as follows: var ms = UnitOfWork.Find<Member>( (Collection traversals in the core API have Any semantics.) |
|