My first attempt to compare DateTime
var searchResult = new PagedData<SAMPLE_STOCK>
{
Data = _db.SAMPLE_STOCK.Where(m => m.LAST_UPDATED.Date == lastUpdate.Date)
};
return PartialView(searcReasult);
it gives the following error
The specified type member 'Date' is not supported in LINQ to
Entities. Only initializers, entity members, and entity navigation
properties are supported.
Then I write following code
var searchResult = new PagedData<SAMPLE_STOCK>
{
Data = _db.SAMPLE_STOCK.Where(m => m.LAST_UPDATED.Day == lastUpdate.Day
&& m.LAST_UPDATED.Month == lastUpdate.Month
&& m.LAST_UPDATED.Year==lastUpdate.Year)
};
It works fine. My question is.... What is the difference between these??