public ActionResult GetFilmDate(String dateTime) { if (dateTime == null) { return(BadRequest()); } DateTime date; try { date = Convert.ToDateTime(dateTime); } catch { ModelState.AddModelError("dateTime", "Недопустимое значение для даты."); return(BadRequest(ModelState)); } MockFilmsTimeTable MockFilm; List <Film> timeTableFilms = MockFilm.GetFilmsDate(date); if (timeTableFilms.Count != 0) { return(Ok(timeTableFilms)); } return(NotFound()); }
public ActionResult GetFilmToday() { MockFilmsTimeTable MockFilm; List <Film> timeTableFilms = MockFilm.GetFilmsDate(DateTime.Today); if (timeTableFilms.Count != 0) { return(Ok(timeTableFilms)); } return(NotFound()); }