public void Patch(string id, [FromBody] MergePatchUomConversionDto value) { try { UomConversionsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _uomConversionApplicationService.When(value as IMergePatchUomConversion); } catch (Exception ex) { var response = UomConversionsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Delete(string id, string commandId, string version, string requesterId = default(string)) { try { var value = new DeleteUomConversionDto(); value.CommandId = commandId; value.RequesterId = requesterId; value.Version = (long)Convert.ChangeType(version, typeof(long)); UomConversionsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _uomConversionApplicationService.When(value as IDeleteUomConversion); } catch (Exception ex) { var response = UomConversionsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteUomConversionDto value) { try { // /////////////////////////////// if (value.Version != default(long)) { value.CommandType = CommandType.MergePatch; UomConversionsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _uomConversionApplicationService.When(value as IMergePatchUomConversion); return; } // /////////////////////////////// UomConversionsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _uomConversionApplicationService.When(value as ICreateUomConversion); } catch (Exception ex) { var response = UomConversionsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }