简体   繁体   中英

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

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?

在您的库中使用“ using system.linq.expressions”

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM