i do a linq query:
var parcels = (from parcel in Db.Parcels
where
(parcel.Neighbors.Count(neig =>
{
var neigType1 = neig.Neighbors as NeigType1;
var neigType2 = neig.Neighbors as NeigType2;
var result = false;
if (neigType1 != null)
{
result = neigType1.Name.Contains(NeigTextBox.Text);
}
if (neigType2 != null)
{
result = кадастроваяОрганизация.Name.Contains(NeigTextBox.Text);
}
return result;
}) > 0)
select parcel).ToList();
But in line (parcel.Neighbors.Count(neig =>
i get an error:
A lambda expression with a statement body cannot be converted to an expression tree
Google says that it because i don't using =>
operator. But where i gonne put it?