Пример #1
0
        public void AddApiScopeApi(string apiScopeName, ApiSingle apiSingle)
        {
            var apiScope = ApiScopeRepository.FirstOrDefault(e => e.Name == apiScopeName);

            if (apiScope == null)
            {
                throw new Exception("找不到Api域");
            }

            apiScope.AddApiScopeApi(apiSingle);
        }
Пример #2
0
        public void RemoveApiScopeApi(int apiScopeId, int apiSingleId)
        {
            var apiScope = ApiScopeRepository.FirstOrDefault(apiScopeId);

            if (apiScope == null)
            {
                throw new Exception("找不到Api域");
            }

            var apiSingle = _apiSingleRepository.Get(apiSingleId);

            if (apiSingle == null)
            {
                throw new Exception("找不到要移除的Api");
            }

            apiScope.RemoveApiScopeApi(apiSingle);
        }