Marius Vasile

Marius Vasile

  • 594
  • 1.9k
  • 145.7k

Cannot get data from database based on specific date

Oct 9 2022 8:35 AM

I am trying to get data from database for a specifc date but the date is stored containing time also.

 

var dataAzi = DateTime.Now.ToShortDateString();
            MemList = await _context.MemoratClassDetails.Include(s => s.MemoratClassSubCategory)
                                                            .ThenInclude(s => s.MemoratClassCategory)
                                                            .Where(s => s.MemDataReminder.ToShortDateString() == dataAzi)
                                                            .ToListAsync();

How can I select data using only date but no time? Curent query gives error

 

 


Answers (1)