I have a method like this:
public List<MyObjects> All<TEntity>(params LambdaExpression[] exprs)
with the intention that I can call it like this:
All<SomeObject>(a => a.Collection1, a=> a.Collection2, a=>a.Collection3);
However, my method signature does not appear to take the expression correctly. What am I doing wrong? How would I write the method signature to get the desired effect?
edited: I realized that my example method call wasn’t accurately reflecting what I was trying to do in real life 🙂
thanks!!
Perhaps the cleanest way in this case would be to write an extension method.
Note that you don’t have to specify type arguments when you’re calling the method because of the type inference.