OneCore.MongoDB
1.1.1.1
dotnet add package OneCore.MongoDB --version 1.1.1.1
NuGet\Install-Package OneCore.MongoDB -Version 1.1.1.1
<PackageReference Include="OneCore.MongoDB" Version="1.1.1.1" />
paket add OneCore.MongoDB --version 1.1.1.1
#r "nuget: OneCore.MongoDB, 1.1.1.1"
// Install OneCore.MongoDB as a Cake Addin #addin nuget:?package=OneCore.MongoDB&version=1.1.1.1 // Install OneCore.MongoDB as a Cake Tool #tool nuget:?package=OneCore.MongoDB&version=1.1.1.1
a MongoDb data access library
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net40 is compatible. net403 was computed. net45 was computed. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
- mongocsharpdriver (>= 1.10.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
public class MongoModel : Entity
{
public string Name { get; set; }
public DateTime UpdateTime { get; set; }
}
var mdb = new OneCore.MongoDB.Mongo<MongoModel>();
if (mdb.Linq().Count() == 0)
{
mdb.Add(new MongoModel()
{
Name = "mongodata",
UpdateTime = DateTime.Now
});
}
var lst2 = mdb.FindList();
........
using connection string
public class MongoDBContext<T> : Mongo<T> where T:Entity
{
private static string conn = System.Configuration.ConfigurationManager.ConnectionStrings["MongoDB"].ConnectionString;
public MongoDBContext() : base(conn) { }
}
var mongodb = new MongoDBContext<MongoModel>();
....more