Please check the method bellow. This method finds for matching date and count that matched data and returns that. Problem is I dont want to match date and time. I only want to match date and count them. Thats why i used ToShortDateString() to convert long date time to simple only date format. But problem is LINQ does not allow me to use ToShortDateString() on TransectionDate. Check debug picture bellow. How can i fix it?
public int ValueCalculator(DateTime date, string ItemID)
{
using (var ctx = new db_DemoEntities())
{
var simpleDate = date.ToShortDateString();
int TotalSold = ctx.EbayUserTransactions.Where(x => x.TransactionDate.ToShortDateString() == simpleDate && x.ItemID == ItemID).Count();
return TotalSold;
}
}