Esempio n. 1
0
        public static IEnumerable <TestPrint> FindPrintFromMongo(DownloadAutomateManager downloadAutomate, string query, int limit = 0, string sort = null)
        {
            if (sort == null)
            {
                sort = "{ 'download.title': 1 }";
            }
            //var query2 = pb.Data.Mongo.MongoCommand.Find("dl", "RapideDdl_Detail2", query, limit: limit, sort: sort, fields: "{ '_id': 1, 'download.title': 1, 'download.creationDate': 1, 'download.category': 1, 'download.isPrint': 1, 'download.sourceUrl': 1  }");
            var query2 = MongoCommand.Find("dl", "RapideDdl_Detail2", query, limit: limit, sort: sort, fields: "{ '_id': 1, 'download.title': 1, 'download.creationDate': 1, 'download.category': 1, 'download.postType': 1, 'download.sourceUrl': 1  }");
            var query3 = query2.Select(document =>
                                       new TestPrint
            {
                title    = document["download"]["title"].AsString,
                category = document["download"]["category"].AsString,
                //isPrint = document["download"]["isPrint"].AsBoolean
                postType = (PrintType)document["download"]["postType"].AsInt32
            }
                                       );

            return(query3);
        }
Esempio n. 2
0
 public static void Test_ViewImagesCache_01()
 {
     //RunSource.CurrentRunSource.View(MongoCommand.Find<MongoImage>("dl", "Images", "{}", sort: "{ 'Height': 1 }").zAction(mongoImage => mongoImage.Image = DownloadPrint.LoadImage(mongoImage.Url)));
     MongoCommand.Find <MongoImage>("dl", "Images", "{}", sort: "{ 'Height': 1 }").zAction(mongoImage => mongoImage.Image = DownloadPrint.LoadImage(mongoImage.Url)).zView();
 }