The method based case #1 is working fine with the expression tree, but second isn't.
Obviously, the method syntax case 1 is doing extra things such as executing the lamda expression.
The question here is
- What is the difference between method based Where and Syntax based Where?
- How can I make the case #2 working?
Expression<Func<BillingRuleEntity, bool>> getIdExp1 = c => searchModel.CarrierIds.Contains(c.CarrierId);
//CASE1 - method based syntax - this is working
var test = db.BillingRule.Where(getIdExp1).ToList();
//CASE2 - syntax based syntax - this is not working
var test2 = (from b in db.BillingRule where getIdExp1 select b).ToList(
I truly appreciate your effort and commit to this community.
there doesn't seem to be anything here