Пример #1
0
        public async Task <IEnumerable <AboutTutorDto> > GetReviewsAsync(CancellationToken token)
        {
            var query  = new AboutTutorQuery();
            var retVal = await _queryBus.QueryAsync(query, token);

            return(retVal.Select(item =>
            {
                item.Image = _urlBuilder.BuildUserImageEndpoint(item.UserId, item.Image);
                return item;
            }));
        }
Пример #2
0
            public async Task <IEnumerable <AboutTutorDto> > GetAsync(AboutTutorQuery query, CancellationToken token)
            {
                const string sql = @"select top 10 u.Id as UserId, u.Name, u.ImageName as Image, tr.Rate, tr.Review
                                        from sb.TutorReview tr
                                        join sb.Tutor t
	                                        on tr.TutorId = t.Id
                                        join sb.[User] u
	                                        on t.Id = u.Id
                                        where len(tr.Review) > 0 and tr.Rate > 3
                                        order by NEWID()";

                using (var conn = _dapperRepository.OpenConnection())
                {
                    var retVal = await conn.QueryAsync <AboutTutorDto>(sql);

                    return(retVal);
                }
            }
Пример #3
0
 public async Task AboutTutorQuery_Ok()
 {
     var query = new AboutTutorQuery();
     var _     = await fixture.QueryBus.QueryAsync(query, default);
 }