Filter list as a parameter in a compiled query
Posted
by JK
on Stack Overflow
See other posts from Stack Overflow
or by JK
Published on 2010-05-24T01:09:07Z
Indexed on
2010/05/24
1:10 UTC
Read the original article
Hit count: 246
entity-framework
|linq.compiledquery
I have the following compiled query that I want to return a list of "groups" that don't have a "GroupID" that's contained in a filtered list:
CompiledQuery.Compile(ConfigEntities contexty, List list) => from c in context.Groups where (!csList.Contains(c.GroupID)) select c).ToList()
However I'm getting the following run-time error: The specified parameter 'categories' of type 'System.Collections.Generic.List`1[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c261364e126]]' is not valid. Only scalar parameters (such as Int32, Decimal, and Guid) are supported.
Any ideas?
© Stack Overflow or respective owner