public ActionResult PostSchedule([FromBody] TimeTableFilms obj) { if (obj == null) { return(BadRequest()); } _db.SetValue(obj.GetType().Name, obj); TimeTableFilms timeTable = _db.GetTimeTableFilm(obj).Result; return(CreatedAtAction("GetFilmSchedule", new { timeTable.id }, timeTable)); }
public ActionResult PutSchedule([FromBody] TimeTableFilms obj) { if (obj == null) { return(BadRequest()); } TimeTableFilms timeTable = _db.GetTimeTableFilm(obj.id).Result; if (timeTable == null) { return(NotFound()); } timeTable.idFilm = obj.idFilm; timeTable.dateTime = obj.dateTime; _db.Save(timeTable.GetType().Name, timeTable.id, timeTable); return(Ok(timeTable)); }