public static Task <IEnumerable <PublicClassifiedAdListItem> > Query(
     this DbConnection connection,
     QueryModels.GetPublishedClassifiedAds query)
 => connection.QueryAsync <PublicClassifiedAdListItem>(
     "SELECT \"ClassifiedAdId\", \"Price_Amount\" price, \"Title_Value\" title " +
     "FROM \"ClassifiedAds\" WHERE \"State\"=@State LIMIT @PageSize OFFSET @Offset",
     new
 {
     State    = (int)ClassifiedAdState.Active,
     PageSize = query.PageSize,
     Offset   = Offset(query.Page, query.PageSize)
 });
 public static Task <List <ReadModels.PublicClassifiedAdListItem> > Query(
     this IAsyncDocumentSession session,
     QueryModels.GetPublishedClassifiedAds query)
 =>
 session.Query <Domain.ClassifiedAd.ClassifiedAd>()
 .Where(x => x.State == Domain.ClassifiedAd.ClassifiedAd.ClassifiedAdState.Active)
 .Select(x =>
         new ReadModels.PublicClassifiedAdListItem
 {
     ClassifiedAdId = x.Id.Value,
     Price          = x.Price.Amount,
     Title          = x.Title.Value,
     CurrencyCode   = x.Price.Currency.CurrencyCode
 })
 .PagedList(query.Page, query.PageSize);
 public Task <IActionResult> Get(QueryModels.GetPublishedClassifiedAds request) =>
 RequestHandler.HandleQuery(() => _session.Query(request), _log);