Esempio n. 1
0
        /// <summary>
        /// 插入测试数据.
        /// </summary>
        private void InsertTestData(MongoCollection <TestLinq> collection)
        {
            TestLinq data1 = new TestLinq()
            {
                FirstName = "Jac",
                LastName  = "Lee",
                SeqNumber = 9,
            };

            TestLinq data2 = new TestLinq()
            {
                FirstName = "Kimi",
                LastName  = "Qiu",
                SeqNumber = 12,
            };

            TestLinq data3 = new TestLinq()
            {
                FirstName = "Edward",
                LastName  = "Wang",
                SeqNumber = 14,
            };

            // 完成插入处理.
            collection.Insert(data1);
            collection.Insert(data2);
            collection.Insert(data3);
        }
        /// <summary>
        /// 插入测试数据.
        /// </summary>
        private void InsertTestData(MongoCollection<TestLinq> collection)
        {
            TestLinq data1 = new TestLinq()
            {
                FirstName = "Jac",
                LastName = "Lee",
                SeqNumber = 9,
            };

            TestLinq data2 = new TestLinq()
            {
                FirstName = "Kimi",
                LastName = "Qiu",
                SeqNumber = 12,
            };

            TestLinq data3 = new TestLinq()
            {
                FirstName = "Edward",
                LastName = "Wang",
                SeqNumber = 14,
            };

            // 完成插入处理.
            collection.Insert(data1);
            collection.Insert(data2);
            collection.Insert(data3);

        }