コード例 #1
0
        public virtual async Task <int> DeleteApiResourcePropertyAsync(ApiResourcePropertiesDto apiResourceProperty)
        {
            var propertyEntity = apiResourceProperty.ToEntity();

            var deleted = await ApiResourceRepository.DeleteApiResourcePropertyAsync(propertyEntity);

            return(deleted);
        }
コード例 #2
0
        public virtual async Task <int> DeleteApiResourcePropertyAsync(ApiResourcePropertiesDto apiResourceProperty)
        {
            var propertyEntity = apiResourceProperty.ToEntity();

            var deleted = await ApiResourceRepository.DeleteApiResourcePropertyAsync(propertyEntity);

            await AuditEventLogger.LogEventAsync(new ApiResourcePropertyDeletedEvent(apiResourceProperty));

            return(deleted);
        }
コード例 #3
0
        public virtual async Task <int> AddApiResourcePropertyAsync(ApiResourcePropertiesDto apiResourceProperties)
        {
            var canInsert = await CanInsertApiResourcePropertyAsync(apiResourceProperties);

            if (!canInsert)
            {
                await BuildApiResourcePropertiesViewModelAsync(apiResourceProperties);

                throw new UserFriendlyViewException(string.Format(ApiResourceServiceResources.ApiResourcePropertyExistsValue().Description, apiResourceProperties.Key), ApiResourceServiceResources.ApiResourcePropertyExistsKey().Description, apiResourceProperties);
            }

            var apiResourceProperty = apiResourceProperties.ToEntity();

            return(await ApiResourceRepository.AddApiResourcePropertyAsync(apiResourceProperties.ApiResourceId, apiResourceProperty));
        }
コード例 #4
0
        public virtual async Task <bool> CanInsertApiResourcePropertyAsync(ApiResourcePropertiesDto apiResourceProperty)
        {
            var resource = apiResourceProperty.ToEntity();

            return(await ApiResourceRepository.CanInsertApiResourcePropertyAsync(resource));
        }
コード例 #5
0
        public async Task <int> DeleteApiResourcePropertyAsync(ApiResourcePropertiesDto apiResourceProperty)
        {
            var propertyEntity = apiResourceProperty.ToEntity();

            return(await _apiResourceRepository.DeleteApiResourcePropertyAsync(propertyEntity));
        }