コード例 #1
0
ファイル: GepItemsDac.cs プロジェクト: tomochandv/Test
 /// <summary>
 /// GEP상품 리스트 페이징
 /// </summary>
 /// <param name="page">페이지</param>
 /// <param name="query">조건</param>
 /// <returns>GepItemsData Class List</returns>
 public MongoPagingResult<GepItemsData> List(int page, QueryComplete query)
 {
     SortByBuilder sort = SortBy.Descending("_id");
     List<GepItemsData> List = new List<GepItemsData>();
     GEPMongoDacHelper MongoHelper = new GEPMongoDacHelper("gep", "gep_items");
     return MongoHelper.FindByPaging<GepItemsData>(query, 10, (10 * (page - 1)), sort);
 }
コード例 #2
0
ファイル: MongoTest.cs プロジェクト: tomochandv/Test
        public void BookPaging(int page)
        {
            int take = 1;
            int skip = page * take;

            IMongoQuery query = Query.And(
                //Query.GTE("_id",BsonObjectId.Create("4f6960fc49674e62601cb869")),
                //Query.EQ("ag", 25)

                Query.EQ("nm", "꽃미남4")
            );

            SortByBuilder sort = SortBy.Ascending("_id");

            GEPMongoDacHelper dac = new GEPMongoDacHelper("test", "book");
            MongoPagingResult<Book> result = dac.FindByPaging<Book>(query, take, skip, sort);

            Trace.WriteLine(result.Count.ToString());

            foreach (Book book in result.Result.ToList())
            {
                Trace.DumpBusinessEntity(book);
            }
        }
コード例 #3
0
ファイル: eBayItemDac.cs プロジェクト: tomochandv/Test
 /// <summary>
 /// eBay 상품 리스트 조회 (페이징)
 /// </summary>
 /// <param name="page"></param>
 /// <param name="query"></param>
 /// <returns></returns>
 public MongoPagingResult<eBayItemsData> List(int page, QueryComplete query)
 {
     SortByBuilder sort = SortBy.Descending("_id");
     GEPMongoDacHelper MongoHelper = new GEPMongoDacHelper(dataBase, collection);
     return MongoHelper.FindByPaging<eBayItemsData>(query, 10, (10 * (page - 1)), sort);
 }