public virtual async Task <ApiScopeDto> AddScopeAsync(ApiScopeCreateDto apiScopeCreate)
        {
            var apiResource = await ApiResourceRepository.GetAsync(apiScopeCreate.ApiResourceId);

            var apiResourceScope = apiResource.FindScope(apiScopeCreate.Name);

            if (apiResourceScope == null)
            {
                apiResource.AddScope(apiScopeCreate.Name, apiScopeCreate.DisplayName, apiScopeCreate.Description,
                                     apiScopeCreate.Required, apiScopeCreate.Emphasize, apiScopeCreate.ShowInDiscoveryDocument);
                apiResourceScope = apiResource.FindScope(apiScopeCreate.Name);
            }
            return(ObjectMapper.Map <ApiScope, ApiScopeDto>(apiResourceScope));
        }
예제 #2
0
 public virtual async Task <ApiScopeDto> AddScopeAsync(ApiScopeCreateDto apiScopeCreate)
 {
     return(await ApiResourceAppService.AddScopeAsync(apiScopeCreate));
 }