I have 2 important date fields in db.
startTime and goTime
I like to create custom query in which one parameter may be empty, see my example
public List<Type> GetAll( DateTime startTime, DateTime goTime )
{
List<Type> getResultBetween =
(from i in DB.TABLENAME
where i.startTime >= startTime && i.goTime == ANYTHING
select i).ToList();
return getResultBetween;
}
So goal is now that I get all up to the given startTime even the goTime is not defined. It should also work if I define the goTime and let the Starttime empty. Resault should give me all till the gotime.
Thank you