public async Task <IActionResult> EditSchedules(string dateTime) { if (!DateTime.TryParse(dateTime, out DateTime date)) { return(BadRequest($"No valid date. Try again and if the problem persist contact administrator.")); } var schedules = await this.SchedulerWorkData.Schedules.FindAsync( s => s.Date.ToString(Constants.DateTimeFormats.Short) == date.ToString(Constants.DateTimeFormats.Short), i => i.Include(x => x.Employee)); return(View(await ScheduleViewModel.CreateCollectionForEditAsync(schedules, this.ScheduleSevice, this.Mapper))); }