public ActionResult Post([FromBody] AutorInputModel autor) { var result = _autorService.Post(autor); return(new CreatedAtRouteResult("GetDetails", new { id = result.Id }, result)); }
public AutorViewModel Put(int id, AutorInputModel autorInputModel) { var autor = _mapper.Map <Autor>(autorInputModel); _uow.AutorRepository.Update(autor); _uow.Commit(); return(_mapper.Map <AutorViewModel>(autor)); }
public AutorViewModel Post(AutorInputModel autorInputModel) { var autor = _mapper.Map <Autor>(autorInputModel); _uow.AutorRepository.Add(autor); _uow.Commit(); return(_mapper.Map <AutorViewModel>(autor)); }
public ActionResult Put(int id, [FromBody] AutorInputModel autor) { if (id != autor.Id) { return(BadRequest()); } var result = _autorService.Put(id, autor); return(new CreatedAtRouteResult("GetDetails", new { id = result.Id }, result)); }