private async Task <bool> IsOpenNow(Guid ID) { var openhours = _context.OpenHoursTb .AsEnumerable() .Where(i => i.Lid == ID && i.Day == (int)DateTime.Today.DayOfWeek && Extentions.Between(DateTime.Now.TimeOfDay, TimeSpan.Parse(i.HourOpen), TimeSpan.Parse(i.HourClose))) .ToList(); if (openhours == null || openhours.Count == 0) { return(false); } else { return(true); } }