예제 #1
0
 public HttpResponseMessage Post([FromBody] Patrimonio patrimonio)
 {
     try
     {
         _patrimonioRepository.PostPatrimonio(patrimonio);
         return(Request.CreateResponse(HttpStatusCode.OK, "Patrimonio cadastrada com sucesso", "application/json"));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message, "application/json"));
     }
 }