public async Task <bool> Handle(RemovePersistedGrantCommand request, CancellationToken cancellationToken) { if (!request.IsValid()) { NotifyValidationErrors(request); return(false);; } var grant = await _persistedGrantRepository.GetGrant(request.Key); if (grant == null) { return(false); } _persistedGrantRepository.Remove(grant); if (await Commit()) { await Bus.RaiseEvent(new PersistedGrantRemovedEvent(request.Key, grant.ClientId, grant.Type, grant.SubjectId)); return(true); } return(false); }
public async Task Handle(RemovePersistedGrantCommand request, CancellationToken cancellationToken) { if (!request.IsValid()) { NotifyValidationErrors(request); return; } // Businness logic here _persistedGrantRepository.Remove(request.Key); if (Commit()) { await Bus.RaiseEvent(new PersistedGrantRemovedEvent(request.Key)); } }
public Task RemoveAsync(string key) { _repository.Remove(key); return(Task.CompletedTask); }