public void Patch(string id, [FromBody] MergePatchOrganizationStructureTypeDto value)
 {
     try {
         OrganizationStructureTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _organizationStructureTypeApplicationService.When(value as IMergePatchOrganizationStructureType);
     } catch (Exception ex) { var response = OrganizationStructureTypesControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
 public void Delete(string id, string commandId, string version, string requesterId = default(string))
 {
     try {
         var value = new DeleteOrganizationStructureTypeDto();
         value.CommandId   = commandId;
         value.RequesterId = requesterId;
         value.Version     = (long)Convert.ChangeType(version, typeof(long));
         OrganizationStructureTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _organizationStructureTypeApplicationService.When(value as IDeleteOrganizationStructureType);
     } catch (Exception ex) { var response = OrganizationStructureTypesControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
예제 #3
0
        public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteOrganizationStructureTypeDto value)
        {
            try {
                // ///////////////////////////////
                if (value.Version != default(long))
                {
                    value.CommandType = CommandType.MergePatch;
                    OrganizationStructureTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                    _organizationStructureTypeApplicationService.When(value as IMergePatchOrganizationStructureType);
                    return;
                }
                // ///////////////////////////////

                OrganizationStructureTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                _organizationStructureTypeApplicationService.When(value as ICreateOrganizationStructureType);
            } catch (Exception ex) { var response = OrganizationStructureTypesControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }