100").ToList(); The " /> 100").ToList(); The " /> 100").ToList(); The "/>

IQStreamable: cannot convert from 'string' to 'System.Linq.Expressions.Expression

1.3k views Asked by At

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?

1

There are 1 answers

0
Ghost On

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