public void Patch(string id, [FromBody] MergePatchInOutDto value) { try { InOutsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _inOutApplicationService.When(value as IMergePatchInOut); } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Delete(string id, string commandId, string version, string requesterId = default(string)) { try { var value = new DeleteInOutDto(); value.CommandId = commandId; value.RequesterId = requesterId; value.Version = (long)Convert.ChangeType(version, typeof(long)); InOutsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _inOutApplicationService.When(value as IDeleteInOut); } catch (Exception ex) { var response = InOutsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteInOutDto value) { try { // /////////////////////////////// if (value.Version != default(long)) { value.CommandType = CommandType.MergePatch; InOutsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _inOutApplicationService.When(value as IMergePatchInOut); return; } // /////////////////////////////// InOutsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _inOutApplicationService.When(value as ICreateInOut); } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }