Okay,
This may be really simple or it may not even be possible, or I am just having a brain freeze :)
Here is an example of what I am trying to do:
public void SomeMethod(bool include)
{
using (AccountDataContext db = AccountContextFactory.CreateContext())
{
if (include)
{
var query = from a in db.FundingTypes where a.FundingTypeId == 1 select a;
}
else
{
var query = from a in db.FundingTypes where a.FundingTypeId != 1 select a;
}
}
}
I would like to dynamically change the != and = without having to write an entire new query. The query that I am using in real life is very large and I don't like code duplication.
Thought or Ideas?
Thanks