public void Patch(string id, [FromBody] MergePatchUomDto value) { try { UomsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _uomApplicationService.When(value as IMergePatchUom); } 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 DeleteUomDto(); value.CommandId = commandId; value.RequesterId = requesterId; value.Version = (long)Convert.ChangeType(version, typeof(long)); UomsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _uomApplicationService.When(value as IDeleteUom); } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteUomDto value) { try { // /////////////////////////////// if (value.Version != default(long)) { value.CommandType = CommandType.MergePatch; UomsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _uomApplicationService.When(value as IMergePatchUom); return; } // /////////////////////////////// UomsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _uomApplicationService.When(value as ICreateUom); } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }