I'm trying the following code..
LoadOperation<Tasks> PhasesLP = context.
Load(context.GetTasksQuery().
Where(o=> ProjectList.Where(p=> p.ProjectID == o.ProjectID).Count() == 1)
I get the following error:
Query operator 'Count' is not supported.
I want to basically be able to specify a Where In
clause instead of Where =
.
Anyone has an idea of how I can achieve this?
Have you tried:
.SingleOrDefault() != null
I'm not familiar with RIA, but sometimes these kinds of alternate equivalent expressions work with EF.
Also, with EF, it's possible to do a SQL-style WHERE IN (...)
using .Any(...)
.
Off the top of my head, this kind of thing works:
entities.Where(e => ids.Any(i => e.Id == i))
ids
may be a list of IDs, another list of entities or a subquery, IIRC.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With