public async Task Update(long id, FilmPersonFormModel model) { var entity = await Unit.FilmPeople.Get(id); Mapper.Map(model, entity); await Unit.Complete(); }
public async Task <IActionResult> Update(long id, [FromBody] FilmPersonFormModel model) { if (!await People.CheckIfExists(id)) { return(NotFound()); } await People.Update(id, model); return(Ok()); }
public async Task <long> Add(FilmPersonFormModel model) { var entity = Mapper.Map <FilmPerson>(model); entity.PublicId = Guid.NewGuid().ToString(); await Unit.FilmPeople.Add(entity); await Unit.Complete(); return(entity.Id); }
public async Task <IActionResult> Add([FromBody] FilmPersonFormModel model) { return(Ok(await People.Add(model))); }