Why does this code generate a NotSupportedException?
- by edg
This is fine
string foo(string f) { return f; }
string bar = foo("");
var item = (from f in myEntities.Beer
where f.BeerName == bar
select f).FirstOrDefault();
and this is fine
string foo(string f) { return f; }
string bar = "";
var items = from f in myEntities.Beer
where f.BeerName == foo(bar)
select f;
So why does this throw System.NotSupportedException?
string foo(string f) { return f; }
string bar = "";
var item = (from f in myEntities.Beer
where f.BeerName == foo(bar)
select f).FirstOrDefault();