示例#1
0
        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));
            }
        }
示例#2
0
 protected Task <IReadOnlyCollection <T> > GetAll()
 {
     return(Task.FromResult(_database.List <T>()));
 }