In using the EntityFramework, I get the error "A lambda expression with a statement body cannot be converted to an expression tree
" when trying to compile the following code:
Obj[] myArray = objects.Select(o =>
{
var someLocalVar = o.someVar;
return new Obj() {
Var1 = someLocalVar,
Var2 = o.var2 };
}).ToArray();
I don't know what the error means and most of all how to fix it. Any help?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…