0

I am using "System.Linq.Dynamic" package for preparing "WHERE" clause like below,

 var customers = GetCustomers().Where("OrderId > 100").ToList();

The above code work fine with plain "Customer" object, but when the same thing I am trying to do with "IQStreamable" customer, I am getting error,

cannot convert from 'string' to 'System.Linq.Expressions.Expression<System.Func<ConsoleApp2.Customer, bool>>'

Code,

public IQStreamable<Object> Do(IQStreamable<Customer> source)
    {
        var test = from m in source.Where("OrderId > 100")
                   select m;
        return test;
    }

I believe the reason could be due to "IQStreamable" form of customer, Is there any way to resolve it?

user584018
  • 10,186
  • 15
  • 74
  • 160
  • 3
    The dynamic overloads applies only to `IQueryable`, not `IQStreamable`. And I doubt it would work due to how dynamic expressions work anyway. I suppose you could try to bridge the gap to make `IQStreamable` wrapped as an `IQueryable` but again, I doubt it would actually function like you would want it to. – Jeff Mercado Apr 23 '17 at 15:49
  • Thanks Jeff for the reply – user584018 Apr 23 '17 at 17:05

1 Answers1

0

Use 'using system.linq.expressions' in your libraries

Ghost
  • 27
  • 7