This commit is contained in:
2026-05-08 04:30:04 +03:30
parent afe5c74d09
commit 34afd95640
20 changed files with 1022 additions and 713 deletions
+5 -3
View File
@@ -8,7 +8,6 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Query;
using MongoDB.Driver;
using MongoDB.Driver.Linq;
using Org.BouncyCastle.Asn1.Ocsp;
using xCommons.Extensions;
using xDataService.Configuration;
using xDataService.Extensions;
@@ -34,6 +33,7 @@ namespace xDataService.MongoRepositories
public List<WriteModel<T>> bulkCollection;
public readonly IMongoCollection<T> collection;
private readonly IXKeyGenerator<T, TKey> keyGenerator;
public readonly XDataBaseConfiguration dbConfiguration;
public readonly XDataServiceConfiguration configuration;
private readonly IXBaseRepositoryEvents<T> baseRepositoryEvents;
#endregion
@@ -41,6 +41,7 @@ namespace xDataService.MongoRepositories
//
#region Constructor ...
protected XBaseMongoRepository(
XDataBaseConfiguration dbConfiguration,
XDataServiceConfiguration configuration,
string collectionName = null,
IXKeyGenerator<T, TKey> keyGenerator = null,
@@ -54,11 +55,12 @@ namespace xDataService.MongoRepositories
.IsNullOrEmpty() ?
typeof(T).Name :
collectionName;
this.dbConfiguration = dbConfiguration;
this.baseRepositoryEvents = baseRepositoryEvents;
//
var client = new MongoClient(configuration.GetMongoDbURI());
var database = client.GetDatabase(configuration.GetMongoDbDatabase());
var client = new MongoClient(dbConfiguration.GetMongoDbURI());
var database = client.GetDatabase(dbConfiguration.GetMongoDbDatabase());
//
bulkCollection = new List<WriteModel<T>>();