예제 #1
0
        public async Task <bool> Execute(string resourceSetId)
        {
            _umaServerEventSource.StartToRemoveResourceSet(resourceSetId);
            if (string.IsNullOrWhiteSpace(resourceSetId))
            {
                throw new ArgumentNullException(nameof(resourceSetId));
            }

            var result = await _resourceSetRepository.Get(resourceSetId);

            if (result == null)
            {
                return(false);
            }

            if (!await _resourceSetRepository.Delete(resourceSetId))
            {
                throw new BaseUmaException(
                          ErrorCodes.InternalError,
                          string.Format(ErrorDescriptions.TheResourceSetCannotBeRemoved, resourceSetId));
            }

            _umaServerEventSource.FinishToRemoveResourceSet(resourceSetId);
            return(true);
        }