public async Task <HttpResponseMessage> PutUsuarioAsync([FromBody] VMUsuario newUsuario, int idUsuario) { var oldUsuario = Mapper.Map <VMUsuario, Usuario>(newUsuario); HttpResponse <Usuario> status = await _usuarioService.PutUsuarioAsync(oldUsuario, idUsuario); return(Request.CreateResponse(status.Status, status.Entity)); }
public async Task <HttpResponseMessage> PostUsuarioAsync([FromBody] VMUsuario newUsuario) { _autoMapperCustom.InicilizarMapper(); var oldUsuario = new Usuario(); var copiaUsuario = Mapper.Map <VMUsuario, Usuario>(newUsuario); HttpResponse <Usuario> status = await _usuariosService.PostUsuarioAsync(copiaUsuario); return(Request.CreateResponse(status.Status, status.Entity)); }