I have to add the following to this filter,
"If the CountryID passed in equals (999) then the search should search all countries, and not filter by country."
what I currently have is this, which totally confuses me.
var query = rep.
FindWhere(c =>
(
countryID.HasValue == false ||
c.CityID == null ||
c.Countries.ID == countryID
)
&&
(
mediaTypeID == 0 ||
c.MediaTypeID == mediaTypeID
)
&& c.Active);
I'm assuming that if any on the conditions in the first parantheses is true then it will match against all countries?! if so then I can add an extra expression in the first parantheses to check for countryID 999?
ps. FindWhere is:
public IQueryable<T> FindWhere(Expression<Func<T, bool>> predicate)
{
return _dbSet.Where(predicate);
}