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