資源簡介
static void InsertTest()
{
var random = new Random();
for (var i = 1; i <= 10; i )
{
var item = new Student()
{
Name = "我的名字" i,
Age = random.Next(25, 30),
State = 0
};
//MongoDbTest.MongoDbHepler
MongoDbTest.MongoDbHepler.Insert(MongoDbTest.DbConfigParams.ConntionString, MongoDbTest.DbConfigParams.DbName, MongoDbTest.CollectionNames.Student, item);
}
}
{
var random = new Random();
for (var i = 1; i <= 10; i )
{
var item = new Student()
{
Name = "我的名字" i,
Age = random.Next(25, 30),
State = 0
};
//MongoDbTest.MongoDbHepler
MongoDbTest.MongoDbHepler.Insert(MongoDbTest.DbConfigParams.ConntionString, MongoDbTest.DbConfigParams.DbName, MongoDbTest.CollectionNames.Student, item);
}
}
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Web;
using?MongoDB.Bson.Serialization.Attributes;
using?MongoDB.Bson;
using?MongoDB.Driver;
using?MongoDB.Driver.Linq;
using?MongoDB.Driver.Builders;
namespace?MongoDb
{
????public?class?MongoCollect
????{
????????public?MongoCollect()?
????????{
????????????this.db_collections?=?new?Dictionary();
????????}
????????//public?MongoCollect(int?operator_id?int?server_id?string?operator_name?string?server_name?string?db_name)
????????//{
????????//????this.operator_id?=?operator_id;
????????//????this.operator_name?=?operator_name;
????????//????this.server_id?=?server_id;
????????//????this.server_name?=?server_name;
????????//????this.db_name?=?db_name;
????????//????this.db_collections?=?new?Dictionary();
????????//}
????????//public?int?operator_id?{?get;?set;?}
????????//public?int?server_id?{?get;?set;?}
????????//public?st
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????376832??2014-08-28?14:39??MongoDbExample\MongoDB.Bson.dll
?????文件?????435200??2014-08-28?14:39??MongoDbExample\MongoDB.Driver.dll
?????文件?????376832??2014-08-28?14:39??MongoDbExample\MongoDbExample\bin\Debug\MongoDB.Bson.dll
?????文件?????435200??2014-08-28?14:39??MongoDbExample\MongoDbExample\bin\Debug\MongoDB.Driver.dll
?????文件???????9216??2016-02-24?08:22??MongoDbExample\MongoDbExample\bin\Debug\MongoDbExample.exe
?????文件??????28160??2016-02-24?08:22??MongoDbExample\MongoDbExample\bin\Debug\MongoDbExample.pdb
?????文件??????11600??2016-02-17?11:24??MongoDbExample\MongoDbExample\bin\Debug\MongoDbExample.vshost.exe
?????文件????????490??2010-03-17?22:39??MongoDbExample\MongoDbExample\bin\Debug\MongoDbExample.vshost.exe.manifest
?????文件???????1284??2014-09-18?19:17??MongoDbExample\MongoDbExample\MongoCollect.cs
?????文件????????395??2014-09-18?17:57??MongoDbExample\MongoDbExample\MongoDBConfig.cs
?????文件???????1243??2014-09-18?17:28??MongoDbExample\MongoDbExample\MongoDBConnectionInfo.cs
?????文件???????2912??2014-09-18?17:30??MongoDbExample\MongoDbExample\MongoDbExample.csproj
?????文件???????1116??2014-09-18?17:30??MongoDbExample\MongoDbExample\MongoDBHelper.cs
?????文件???????6150??2016-02-24?08:22??MongoDbExample\MongoDbExample\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件???????1234??2016-02-24?08:22??MongoDbExample\MongoDbExample\obj\x86\Debug\MongoDbExample.csproj.FileListAbsolute.txt
?????文件??????19001??2016-02-24?08:22??MongoDbExample\MongoDbExample\obj\x86\Debug\MongoDbExample.csprojResolveAssemblyReference.cache
?????文件???????9216??2016-02-24?08:22??MongoDbExample\MongoDbExample\obj\x86\Debug\MongoDbExample.exe
?????文件??????28160??2016-02-24?08:22??MongoDbExample\MongoDbExample\obj\x86\Debug\MongoDbExample.pdb
?????文件??????17195??2014-09-18?17:30??MongoDbExample\MongoDbExample\obj\x86\Debug\ResolveAssemblyReference.cache
?????文件???????3503??2014-09-18?19:33??MongoDbExample\MongoDbExample\Program.cs
?????文件???????1384??2014-09-18?17:23??MongoDbExample\MongoDbExample\Properties\AssemblyInfo.cs
?????文件???????3549??2016-02-17?10:39??MongoDbExample\MongoDbExample.sln
????..A..H.?????44544??2016-05-30?15:03??MongoDbExample\MongoDbExample.suo
?????目錄??????????0??2014-09-18?17:23??MongoDbExample\MongoDbExample\obj\x86\Debug\TempPE
?????目錄??????????0??2016-02-24?08:22??MongoDbExample\MongoDbExample\obj\x86\Debug
?????目錄??????????0??2016-02-17?11:13??MongoDbExample\MongoDbExample\bin\Debug
?????目錄??????????0??2014-09-18?17:23??MongoDbExample\MongoDbExample\obj\x86
?????目錄??????????0??2014-09-18?17:23??MongoDbExample\MongoDbExample\bin
?????目錄??????????0??2014-09-18?17:23??MongoDbExample\MongoDbExample\obj
?????目錄??????????0??2014-09-18?17:23??MongoDbExample\MongoDbExample\Properties
............此處省略5個文件信息
- 上一篇:C# 內容繁簡轉換
- 下一篇:基于Lambda的ORM原型
評論
共有 條評論