LT.Chakra.Core.MongoDb
1.0.2
dotnet add package LT.Chakra.Core.MongoDb --version 1.0.2
NuGet\Install-Package LT.Chakra.Core.MongoDb -Version 1.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LT.Chakra.Core.MongoDb" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LT.Chakra.Core.MongoDb --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: LT.Chakra.Core.MongoDb, 1.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install LT.Chakra.Core.MongoDb as a Cake Addin
#addin nuget:?package=LT.Chakra.Core.MongoDb&version=1.0.2
// Install LT.Chakra.Core.MongoDb as a Cake Tool
#tool nuget:?package=LT.Chakra.Core.MongoDb&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
LT.Chakra.Core.MongoDb
Provider for MongoDb in Chakra.Core Framework
Prerequisites
.NETStandard 2.0
Chakra.Core (>= 2.0.7)
LT.PluralizeEn (>= 1.0.1)
MongoDB.Driver (>= 2.5.0)
Example
Startup project class
class Program
{
static void Main(string[] args)
{
SessionFactory.RegisterDefaultDataSession<MongoDbDataSession<DevMongoDbOptions>>();
//INITIALIZE SESSION DOMAIN
using (var DataSession = SessionFactory.OpenSession())
{
using (var Layer = new MainServiceLayer(DataSession))
{
//ADD FIRST 500 COLLECTIONS
MongoTestClassRepository _repo = new MongoTestClassRepository(new MongoDbDataSession());
do
{
var tmpEntity = new Entities.TestClass
{
Property1 = RandomGen.GenericInt(10000),
Property2 = RandomGen.GenericString(250, 20),
Property3 = RandomGen.GenericDate(),
Property4 = null,
Property5 = RandomGen.GenericNullableDate(60),
Property6 = null
};
Layer.SaveTest(ref tmpEntity);
Task.Delay(5000).Wait();
} while (Layer.Count()<500);
// GET SINGLE ENTITY
var resS = Layer.GetSingle("de3318bd-d5db-4f1e-8130-cfed77039e93");
//FETCH ALL
var resF = Layer.Fetch();
//FETCH WITH FILTER
var respFF = Layer.Fetch(c => c.Property1 == 1);
//COUNT THE ENTITIES
var resC = Layer.Count();
//DELETE AN ENTITY
Layer.Delete(resS);
}
}
Console.ReadKey();
}
}
Db Options class
public class DevMongoDbOptions : MongoDbOptions
{
//Class for Mongo Db Connection, it's possible set the connection string or
//the singles parameters
public DevMongoDbOptions()
{
//mongodb://router1.example.com:27017,router2.example2.com:27017,router3.example3.com:27017/
//mongodb://example1.com,example2.com,example3.com/?replicaSet=test&w=2&wtimeoutMS=2000
//mongodb://localhost,localhost:27018,localhost:27019/?replicaSet=test
//mongodb://db1.example.net,db2.example.com/?replicaSet=test
//mongodb://sysop:moon@localhost/records
//mongodb://db1.example.net:27017,db2.example.net:2500/?replicaSet=test&connectTimeoutMS=300000
//mongodb+srv://server.example.com/
//mongodb://db1.example.net:27017,db2.example.net:2500/?replicaSet=test
//ConnectionString = "mongysop:moon@localhost/records";
//SERVER AND PORT
MongoDbHostsUrl = "XXX.XXX.XXX.XXX:XXXX";
//Mongo User Name (Optional)
MongoDbUser = "test";
//Mongo Password (Optional)
MongoDbPassword = "test";
//Mongo Db Name
MongoDbName = "TestDb";
//If user is in AdminDb (Optional)
UserOfAdminDb = true;
//UseDNSSeedlist = true;
}
}
Authors
License
This project is licensed under the MIT License
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Chakra.Core (>= 2.0.7)
- LT.PluralizeEn (>= 1.0.1)
- MongoDB.Driver (>= 2.5.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.