public IHttpActionResult Add(AutorViewModel autorFromView) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _autorService.Create(Mapper.Map <AutorViewModel, AutorDTO>(autorFromView)); return(Ok(autorFromView)); }
public ActionResult Autor([FromBody] CriarAutorRequest create) { _Service.Create(create.Nome, create.Sobrenome, create.Datanascimento, create.Email, create.Senha); return(Created("api/[controller]", create)); }