public IActionResult PostFilm([FromBody] Models.Film film) { if (film == null) { return(BadRequest("Film is null.")); } var eFilm = mapModelToEntity.ConvertObject(film); _service.Create(eFilm); return(Ok("Successfully added!")); }
public IActionResult PutFilm([FromRoute] int id, [FromBody] Models.Film filmUpdated) { if (filmUpdated == null) { return(BadRequest("Film is null.")); } var film = _service.Get(id); if (film == null) { return(NotFound("Film couldn't be found.")); } var mFilm = mapModelToEntity.ConvertObject(filmUpdated); _service.Update(film, mFilm); return(NoContent()); }