示例#1
0
        public async Task <Boolean> Handle(DeleteDHCPv4ScopeCommand request, CancellationToken cancellationToken)
        {
            if (rootScope.GetScopeById(request.ScopeId) == DHCPv4Scope.NotFound)
            {
                logger.LogInformation("unable to delete the scope {scopeId}. Scope not found");
                return(false);
            }

            rootScope.DeleteScope(request.ScopeId, request.IncludeChildren);

            Boolean result = await storageEngine.Save(rootScope);

            if (result == false)
            {
                logger.LogError("unable to delete the scope {scopeId}. Saving changes failed", request.ScopeId);
            }
            return(result);
        }