1
I have the following appointment at the bank;
consultas = ctx.Consultas.Include(c => c.Cliente).Include(p => p.Procedimento).ToList();
which works perfectly, but I want to include a Where to filter by scheduling date, I have tried some ways as:
consultas = ctx.Consultas.Where(a => a.Inicio.Date.ToString("yyyy-MM-dd") == entrada).Include(c => c.Cliente).Include(p => p.Procedimento).ToList();`
or
consultas = ctx.Consultas.Where(a => a.Inicio.Date == DateTime.Parse(entrada)).Include(c => c.Cliente).Include(p => p.Procedimento).ToList();`
as well as other variations like this, however my problem persists, a return of an empty list, this field in my database (mysql) is in the following format 2019-05-14 12:30:00 (yyyy-MM-dd HH:mm:ss), my query should disregard the time, I have tried to pass the input both as string and also datetime
Already used Dbfunctions.Truncatetime?
– SylvioT
Hello Lucas this field Inicio is a Datetime ?
– Luciano Oiticica Lemgruber