dapper-repositories
dapper-repositories copied to clipboard
Support for .Equals() and .Any() | .All()
Eg: var options = new[] {"opt1","opt2"}; //List/array strings
var results = _repository.FindAll( x=> x.property1.Equals(val1) && options.Any( sVals => x.property2.StartsWith(sVals));
I know that "==" is the same as .Equals () and I am currently using it, but I would like to know if it can be used in the future.
Thank you very much and excellent library
I can take a look for nexts relases, but atm i'll be focused on nested joins and others improvements
Hi Paulo, I'm calling your library from a vb.net proyect. When I have an string comparision I get this exception: "System.InvalidCastException: Unable to cast object of type 'System.Linq.Expressions.MethodCallExpressionN' to type 'System.Linq.Expressions.MemberExpression'" This is because vb.net always wraps expression into Operators.CompareString(x.MyPropertyString, "stringValue", true) So I have no choice, I need to use string.Equals but I get an exception saying that Equals is not supported. Are you planning to release this enhancement soon?
I can take a look, but atm i'm busy with GroupBy and other some features
I have attached a zip file with proposed changes to support Equals expression
SqlGenerator.GetQueryProperties.zip
Thanks,
Equals is done. I just need time to research abou ANY and ALL
Equals
implemented. Can create separate tickets for Any
and All
if it still need. Closed!