コード例 #1
0
        public async Task <PageResponse <Document> > GetDocumentsAsync(IDbConnection dbConnection, PageRequest pageRequest)
        {
            _logger.LogInformation($"Getting documents page '{pageRequest}'...");
            var dalObject = await _dbContext.GetDocumentsAsync(dbConnection, pageRequest);

            return(_mapper.Map <PageResponse <Document> >(dalObject));
        }
コード例 #2
0
        public async void GetDocumentsAsync()
        {
            _logger.LogInformation("GetDocumentsAsync...");
            var pageRequest = new PageRequest()
            {
                SortBy    = "LastWrite",
                SortOrder = SortOrders.DESC,
                PageIndex = 0,
                PageSize  = 50
            };

            using (var dbConnection = await _dbConnectionFactory.OpenUserConnectionAsync(UserId))
            {
                var result = await _dbContext.GetDocumentsAsync(dbConnection, pageRequest);

                Assert.NotNull(result);
            }
        }