public async Task On(MediaDeleted @event) { var articleReadModels = _database .List <ArticleReadModel>() .Where(x => x.MediaId == @event.Id) .ToList(); foreach (var articleReadModel in articleReadModels) { await _commandDispatcher.Dispatch(new DeleteArticleCommand(articleReadModel.ArticleId)); } }
protected Task <IReadOnlyCollection <T> > GetAll() { return(Task.FromResult(_database.List <T>())); }