Beispiel #1
0
 public object Delete([FromServices] ISalaAppService salaAppService,
                      [FromBody] SalaViewModel salaViewModel)
 {
     salaAppService.Excluir(salaViewModel);
     return(new
     {
         errors = false,
         message = "Cadastro efetuado com sucesso."
     });
 }
        public HttpResponseMessage Delete(int id)
        {
            try
            {
                appService.Excluir(id);

                return(Request.CreateResponse(HttpStatusCode.OK));
            }
            catch (Exception e)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, e.Message)); // http 400
            }
        }