Esempio n. 1
0
        public Task Remove(RemovePersistedGrantViewModel model)
        {
            // kiss
            var command = _mapper.Map <RemovePersistedGrantCommand>(model);

            return(Bus.SendCommand(command));
        }
Esempio n. 2
0
        public async Task <ActionResult> Remove(string id)
        {
            var model = new RemovePersistedGrantViewModel(id.FromBase64UrlSafe().FromUtf8Bytes());
            await _persistedGrantAppService.Remove(model);

            return(ResponseDelete());
        }
Esempio n. 3
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);
        }