Пример #1
0
        private async Task <IReadOnlyCollection <DiscussionReadModel> > LoadDiscussions()
        {
            var query  = new DiscussionTopicQuery(User, Id);
            var result = await Mediator.Send(query);

            return(result);
        }
Пример #2
0
        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);
        }