public async Task <IActionResult> Put( [FromServices] ITransactionBO transactionBO, string id, [FromBody] Transaction transaction) { try { int result = await transactionBO.Update(id, transaction); if (result == 1) { return(NoContent()); } else { return(UnprocessableEntity("Error on update")); } } catch (Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException e) { return(NotFound(e.Message)); } catch (DbException e) { return(UnprocessableEntity(e.Message)); } catch (Exceptions.NotFoundException e) { return(NotFound("Not Found")); } catch (System.Exception e) { return(BadRequest(e.Message)); } }