public Task Remove(RemovePersistedGrantViewModel model) { // kiss var command = _mapper.Map <RemovePersistedGrantCommand>(model); return(Bus.SendCommand(command)); }
public async Task <ActionResult> Remove(string id) { var model = new RemovePersistedGrantViewModel(id.FromBase64UrlSafe().FromUtf8Bytes()); await _persistedGrantAppService.Remove(model); return(ResponseDelete()); }
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); }