コード例 #1
0
        public virtual async Task <ApiScopePropertiesDto> GetApiScopePropertyAsync(int apiScopePropertyId)
        {
            var apiScopeProperty = await ApiScopeRepository.GetApiScopePropertyAsync(apiScopePropertyId);

            if (apiScopeProperty == null)
            {
                throw new UserFriendlyErrorPageException(string.Format(ApiScopeServiceResources.ApiScopePropertyDoesNotExist().Description, apiScopePropertyId));
            }

            var apiScopePropertiesDto = apiScopeProperty.ToModel();

            apiScopePropertiesDto.ApiScopeId   = apiScopeProperty.ScopeId;
            apiScopePropertiesDto.ApiScopeName = await ApiScopeRepository.GetApiScopeNameAsync(apiScopeProperty.ScopeId);

            await AuditEventLogger.LogEventAsync(new ApiScopePropertyRequestedEvent(apiScopePropertyId, apiScopePropertiesDto));

            return(apiScopePropertiesDto);
        }