private async Task <IReadOnlyCollection <DiscussionReadModel> > LoadDiscussions() { var query = new DiscussionTopicQuery(User, Id); var result = await Mediator.Send(query); return(result); }
protected override async Task <IReadOnlyCollection <DiscussionReadModel> > Process(DiscussionTopicQuery request, CancellationToken cancellationToken) { var query = DataContext.Discussions .AsNoTracking() .Where(s => s.TopicId == request.TopicId); var result = await query .ProjectTo <DiscussionReadModel>(Mapper.ConfigurationProvider) .ToListAsync(cancellationToken); return(result); }