Example #1
0
 public void Patch(string id, [FromBody] MergePatchUomTypeDto value)
 {
     try {
         UomTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _uomTypeApplicationService.When(value as IMergePatchUomType);
     } catch (Exception ex) { var response = UomTypesControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Example #2
0
 public void Delete(string id, string commandId, string version, string requesterId = default(string))
 {
     try {
         var value = new DeleteUomTypeDto();
         value.CommandId   = commandId;
         value.RequesterId = requesterId;
         value.Version     = (long)Convert.ChangeType(version, typeof(long));
         UomTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _uomTypeApplicationService.When(value as IDeleteUomType);
     } catch (Exception ex) { var response = UomTypesControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Example #3
0
        public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteUomTypeDto value)
        {
            try {
                // ///////////////////////////////
                if (value.Version != default(long))
                {
                    value.CommandType = CommandType.MergePatch;
                    UomTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                    _uomTypeApplicationService.When(value as IMergePatchUomType);
                    return;
                }
                // ///////////////////////////////

                UomTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                _uomTypeApplicationService.When(value as ICreateUomType);
            } catch (Exception ex) { var response = UomTypesControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }