I have the following code:
string s = "123,12346";
bool b = s.Contains("1234");
The above returns true, but is there a way to return false. I have already done something like:
string[] s = {"123","12346"};
bool b = s.Contians("1234");
The above works, but I can't use the above in a contains expression with LINQ-To-Entities
because it does not like Contains in pre EF 4.0
.
I have an extension method which behaves like a SQL IN
clause, but I need to explicitly type the parameters when I use it, I am not sure what to put between the brackets:
predicate = predicate(x=> WhereIn<>(x.Id, Ids));
x.Id is a string and Ids is a string
as well. If I put WhereIn<string,string>
, it complains that Argument type string is not assignable to parameter type ObjectQuery<string>
predicate
comes from the PredicateBuilder
: http://www.albahari.com/nutshell/predicatebuilder.aspx