91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 898KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-01
  • 語言: C#
  • 標簽: MongoDB類??C#??MongoDB??

資源簡介

.net平臺(C#)MongoDB最新版操作類 MongoDB操作類源碼包括添加、修改、刪除和查詢(包括分頁)等同步及異步操作類完整的代碼。 本項目是以最新版的MVC結合MongoDB呈現,對MongoDB有興趣的朋友很有參考價值。 可以直接拿到自己的項目直接開發,可以少走彎路。

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.Linq.expressions;
using?System.Threading.Tasks;
using?framework.MongoDB.Extension;
using?framework.MongoDB.Model;
using?frameWork.Extension;
using?frameWork.MongoDB.MongoDbConfig;
using?MongoDB.Bson.Serialization.Conventions;
using?MongoDB.Driver;

namespace?frameWork.MongoDB
{
????#region?MongoDb操作封裝
????///?
????///?MongoDb操作封裝
????///?

????public?class?MongoDbService
????{
????????#region?初始化

????????private?readonly?string?_connString?=?“MongoDb“.ValueOfAppSetting();
????????private?readonly?MongoClient?_mongoClient;

????????public?MongoDbService()
????????{
????????????ConventionRegistry.Register(“IgnoreExtraElements“?new?ConventionPack?{?new?IgnoreExtraElementsConvention(true)?}?type?=>?true);
????????????_mongoClient?=?new?MongoClient(_connString);
????????}

????????#endregion

????????#region?增

????????#region?增(同步)

????????///?
????????///?新增數據
????????///?

????????///?
????????///?se“>庫
????????///?集合(表)
????????///?實體(文檔)
????????public?void?Add(string?database?string?collection?T?entity)?where?T?:?MongoEntity
????????{
????????????AddAsync(database?collection?entity).Wait();
????????}

????????///?
????????///?新增數據
????????///?

????????///?
????????///?實體(文檔)
????????public?void?Add(T?entity)?where?T?:?MongoEntity
????????{
????????????AddAsync(entity).Wait();
????????}

????????#endregion

????????#region?增(異步)

????????///?
????????///?增(異步)
????????///?

????????///?
????????///?se“>庫
????????///?集合(表)
????????///?實體(文檔)
????????///?
????????public?async?Task?AddAsync(string?database?string?collection?T?entity)?where?T?:?MongoEntity
????????{
????????????var?db?=?_mongoClient.GetDatabase(database);
????????????var?coll?=?db.GetCollection(collection);
????????????await?coll.InsertOneAsync(entity).ConfigureAwait(false);
????????}

????????///?
????????///?增(異步)
????????///?

????????///?
????????///?實體(文檔)
????????///?
????????public?Task?AddAsync(T?entity)?where?T?:?MongoEntity
????????{
????????????var?mongoAttribute?=?typeof(T).GetMongoAttribute();
????????????if?(mongoAttribute.IsNull())
????????????????throw?new?ArgumentException(“MongoAttribute不能為空“);

????????????return?AddAsync(mongoAttribute.Database?mongoAttribute.Collection?entity);
????????}

????????#endregion

????????#endregion

????????#region?批量增

????????#region?批量增(異步)

????????///?
????????///?批量增(異步)
????????///?

????????///?
????????///?

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

????.......??????6405??2017-06-13?21:12??framework.MongoDB\Extension\MongoDbexpression.cs

????.......??????2865??2017-06-13?21:12??framework.MongoDB\Extension\MongoDbExtension.cs

????.......??????3188??2017-06-13?21:12??framework.MongoDB\framework.MongoDB.csproj

????.......??????2097??2017-06-13?21:12??framework.MongoDB\Model\PageList.cs

????.......??????5520??2017-06-13?21:12??framework.MongoDB\Model\Types.cs

????.......???????638??2017-06-13?21:12??framework.MongoDB\MongoDbConfig\MongoAttribute.cs

????.......???????189??2017-06-13?21:12??framework.MongoDB\MongoDbConfig\MongoEntension.cs

????.......???????243??2017-06-13?21:12??framework.MongoDB\MongoDbConfig\MongoEntity.cs

?????文件??????25925??2018-06-12?15:55??framework.MongoDB\MongoDbService.cs

?????文件???????6956??2018-06-12?15:36??framework.MongoDB\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

?????文件??????????0??2018-06-12?15:36??framework.MongoDB\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

?????文件??????????0??2018-06-12?15:36??framework.MongoDB\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

?????文件??????????0??2018-06-12?15:36??framework.MongoDB\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

????.......??????1340??2017-06-13?21:12??framework.MongoDB\Properties\AssemblyInfo.cs

????.......???????591??2017-06-13?21:12??framework.MongoDb.Web\App_Start\RouteConfig.cs

????.......????408064??2017-06-13?21:12??framework.MongoDb.Web\bin\MongoDB.Bson.dll

????.......????120502??2017-06-13?21:12??framework.MongoDb.Web\Content\bootstrap.css

????.......?????97949??2017-06-13?21:12??framework.MongoDb.Web\Content\bootstrap.min.css

????.......???????316??2017-06-13?21:12??framework.MongoDb.Web\Content\Site.css

????.......?????14079??2017-06-13?21:12??framework.MongoDb.Web\fonts\glyphicons-halflings-regular.eot

????.......?????63157??2017-06-13?21:12??framework.MongoDb.Web\fonts\glyphicons-halflings-regular.svg

????.......?????29512??2017-06-13?21:12??framework.MongoDb.Web\fonts\glyphicons-halflings-regular.ttf

????.......?????16448??2017-06-13?21:12??framework.MongoDb.Web\fonts\glyphicons-halflings-regular.woff

????.......??????7703??2017-06-13?21:12??framework.MongoDb.Web\framework.MongoDb.Web.csproj

????.......???????112??2017-06-13?21:12??framework.MongoDb.Web\Global.asax

????.......???????417??2017-06-13?21:12??framework.MongoDb.Web\Global.asax.cs

????.......???????699??2017-06-13?21:12??framework.MongoDb.Web\Models\User.cs

?????文件??????10478??2018-06-12?15:36??framework.MongoDb.Web\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

?????文件??????????0??2018-06-12?15:36??framework.MongoDb.Web\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

?????文件??????????0??2018-06-12?15:36??framework.MongoDb.Web\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

............此處省略75個文件信息

評論

共有 條評論