public HttpResponseMessage Put(CommitDto dto) { try { if (dto != null) { CommitRepository.Update(dto); return(Request.CreateResponse(HttpStatusCode.OK)); } return(Request.CreateResponse(HttpStatusCode.BadRequest)); } catch (ElementNotFoundException e) { return(Request.CreateResponse(HttpStatusCode.BadRequest, e.Message)); } catch (Exception) { return(Request.CreateResponse(HttpStatusCode.BadRequest, "Generic error happened.")); } }