mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-20 18:48:09 +08:00
Add MongoDb Csproj
This commit is contained in:
28
Src/Asp.NetCore2/MongoDbTest/AdoTest.cs
Normal file
28
Src/Asp.NetCore2/MongoDbTest/AdoTest.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using MongoDb.Ado.data;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Driver;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MongoDbTest
|
||||
{
|
||||
public class AdoTest
|
||||
{
|
||||
public static void Init()
|
||||
{
|
||||
//开发中
|
||||
var client = new MongoClient("");
|
||||
var database = client.GetDatabase("test");
|
||||
// 获取当前数据库中的所有集合
|
||||
var collections = database.ListCollections();
|
||||
|
||||
|
||||
MongoDbConnection connection = new MongoDbConnection("");
|
||||
connection.Open();
|
||||
connection.Close();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user