Breeze / breeze.server.net

Breeze support for .NET servers
MIT License
76 stars 62 forks source link

Fixed issue with 'in' operator only working with strings #127

Closed clickonben closed 2 years ago

clickonben commented 3 years ago

If the server is queried with any predicate that uses the "in" operator on a field that is anything other than a string type then it throws an exception in this section in Breeze.Core.BinaryPredicate

else if (op == BinaryOperator.In) { // TODO: need to generalize this past just 'string' var mi = TypeFns.GetMethodByExample((List list) => list.Contains("abc"), expr1.Type); return Expression.Call(expr2, mi, expr1); }

This is because mi is List.Contains() but expr1 and expr2 are of type List where T is not a string.

My change should work for any T.

steveschmitt commented 3 years ago

Great idea! Thanks!

christianacca commented 2 years ago

Any time frame on getting this fix included in AspNetCore-v5 and AspNetCore-v6 sources?