I have this function has two requirements
return only orders that have an
OrderDate
value other than nullreturn orders that were placed in the year specified in the parameter year or later
Which WHERE
statement meets the requirements? And why?
static IQueryable<Order> lookUp (int year)
{
using (DataClasses1DataContext d = new DataClasses1DataContext())
{
var orders = from order in d.Orders
This line ==> where order.OrderDate.HasValue && order.OrderDate.Value.Year >=year
OR ==> where order.OrderDate.Value!=null && order.OrderDate.Value.Year >=year
select order;
return orders.ToList();
}
}