Esempio n. 1
0
 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); }
 }
Esempio n. 2
0
 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); }
 }
Esempio n. 3
0
        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); }
        }