public async Task ShouldAddNewIdentityResource()
        {
            var command = IdentityResourceFaker.GenerateIdentiyResource().Generate();

            await _identityResource.Save(command);

            _database.IdentityResources.FirstOrDefault(s => s.Name == command.Name).Should().NotBeNull();
        }
        public async Task <ActionResult <DefaultResponse <bool> > > Save([FromBody] IdentityResource model)
        {
            if (!ModelState.IsValid)
            {
                NotifyModelStateErrors();
                return(Response(false));
            }
            await _identityResourceAppService.Save(model);

            return(Response(true));
        }
Пример #3
0
        public async Task <ActionResult <IdentityResource> > Save([FromBody] IdentityResource model)
        {
            if (!ModelState.IsValid)
            {
                NotifyModelStateErrors();
                return(ModelStateErrorResponseError());
            }
            await _identityResourceAppService.Save(model);

            var idr = await _identityResourceAppService.GetDetails(model.Name);

            return(ResponsePost(nameof(Details), new { resource = model.Name }, idr));
        }