Exemplo n.º 1
0
        public async Task <ActionResult> Remove(string id)
        {
            var model = new RemovePersistedGrantViewModel(id.FromBase64UrlSafe().FromUtf8Bytes());
            await _persistedGrantAppService.Remove(model);

            return(ResponseDelete());
        }
Exemplo n.º 2
0
        public async Task <ActionResult <DefaultResponse <bool> > > Remove([FromBody] RemovePersistedGrantViewModel model)
        {
            if (!ModelState.IsValid)
            {
                NotifyModelStateErrors();
                return(Response(false));
            }
            await _persistedGrantAppService.Remove(model);

            return(Response(true));
        }
        public async Task Should_Remove_Grant()
        {
            _database.PersistedGrants.Add(new PersistedGrant()
            {
                ClientId     = "clientId",
                CreationTime = DateTime.Now,
                Key          = "teste"
            });
            await _database.SaveChangesAsync();

            InMemoryData.DetachAll();

            var command = new RemovePersistedGrantViewModel("teste");


            await _persistedGrant.Remove(command);

            _database.PersistedGrants.Count().Should().Be(0);
        }