Пример #1
0
        public async Task <IActionResult> UpdateApiScope(MScopeDto dto)
        {
            var resourceInDB = await ApiScopesService.GetApiScopeAsync(dto.Id);

            var updated = _mapper.Map(dto, resourceInDB);

            await ApiScopesService.UpdateApiScopeAsync(updated);

            return(Ok());
        }
Пример #2
0
        public async Task CreateApiScopeAsync(MScopeDto dto)
        {
            var resource = _mapper.Map <Scope>(dto);

            resource.Type = ScopeType.ApiScope;
            await DbContext.Scopes.AddAsync(resource);

            await DbContext.SaveChangesAsync();

            EventDispatcher.DispatchCreatedEvent("IDPApiScopes", _mapper.Map <MScopeDto>(resource));
        }
Пример #3
0
        public async Task <IActionResult> CreateApiScope(MScopeDto dto)
        {
            await ApiScopesService.CreateApiScopeAsync(dto);

            return(Ok());
        }
Пример #4
0
        public async Task <IActionResult> CreateIdentityResource(MScopeDto dto)
        {
            await IdentityResourcesService.CreateIdentityResourceAsync(dto);

            return(Ok());
        }