LINQ: Why does Expression.Call() reference the Db when CreateQuery() does as well?

I believe what you're asking is why the third parameter (array of types) is needed in Expression. Call because if you did it through code, you'd only have to do this: custs. Where(pred) The reason why the code works without the generic parameter is because of implicit typing where the compiler translates that automatically to: custs.

Where(pred) After it translates it, the actual bytecode contains the call with the generics specified. When you build the Expression you don't have all the niceties like implicit typing, so you have to specify exactly what gets called.

I believe what you're asking is why the third parameter (array of types) is needed in Expression. Call because if you did it through code, you'd only have to do this: custs. Where(pred); The reason why the code works without the generic parameter is because of implicit typing, where the compiler translates that automatically to: custs.

Where(pred); After it translates it, the actual bytecode contains the call with the generics specified. When you build the Expression, you don't have all the niceties like implicit typing, so you have to specify exactly what gets called.

IQueryable custs = db. ParameterExpression param = Expression. Expression right = Expression.

Expression left = Expression. Expression filter = Expression. Expression pred = Expression.

Expression expr = Expression. Call(typeof(Queryable), "Where", new Type { typeof(Customer) }, Expression. IQueryable query = db.Customers.AsQueryable().Provider.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions