Пример #1
0
 public void Patch(string id, [FromBody] MergePatchDamageTypeDto value)
 {
     try {
         DamageTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _damageTypeApplicationService.When(value as IMergePatchDamageType);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Пример #2
0
 public void Delete(string id, string commandId, string version, string requesterId = default(string))
 {
     try {
         var value = new DeleteDamageTypeDto();
         value.CommandId   = commandId;
         value.RequesterId = requesterId;
         value.Version     = (long)Convert.ChangeType(version, typeof(long));
         DamageTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _damageTypeApplicationService.When(value as IDeleteDamageType);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Пример #3
0
        public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteDamageTypeDto value)
        {
            try {
                // ///////////////////////////////
                if (value.Version != default(long))
                {
                    value.CommandType = CommandType.MergePatch;
                    DamageTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                    _damageTypeApplicationService.When(value as IMergePatchDamageType);
                    return;
                }
                // ///////////////////////////////

                DamageTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                _damageTypeApplicationService.When(value as ICreateDamageType);
            } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }