Hi,
You could add a check-function which returns a bool.
Something like this:
private bool TestValue(int id, int contiditon)
{
if (condition == 1)
{
return id <= 5;
}
else
{
return id >= 5;
}
}
var filtered = from c in country
where TestValue(c.Id, c.Condition)
select c;
This is completely untested so it could contain errors ;)
Hope this helps.
Best regards and happy coding,
Stops