Exemplo n.º 1
0
 /// <summary>
 /// Only for test
 /// </summary>
 /// <param name="db"></param>
 /// <param name="dbLock"></param>
 /// <param name="upgrades"></param>
 /// <param name="initializer"></param>
 /// <param name="settings"></param>
 /// <param name="tracker"></param>
 /// <param name="logFactory"></param>
 public MongoMigrator(
     IMongoDatabase db,
     IMigrationChain upgrades,
     IUpgrade initializer,
     IUpgradeSettings settings,
     IDbLock dbLock,
     IMigrationTracker tracker,
     ILoggerFactory logFactory)
 {
     _log                     = logFactory.CreateLogger <MongoMigrator>();
     _logFactory              = logFactory;
     _db                      = db;
     _upgrades                = upgrades;
     _initializer             = initializer;
     _settings                = settings;
     _dbLock                  = dbLock;
     _tracker                 = tracker;
     _isTransactionsAvailable = _db.Client.Cluster.Description.Type > ClusterType.Standalone;
 }
 public MongoMigrationTracker(IUpgradeSettings settings, IMongoDatabase db)
 {
     _settings      = settings;
     _verCollection = db.GetCollection <DbVersion>(settings.VersionCollectionName);
 }
 public MongoDbLock(IUpgradeSettings settings, IMongoDatabase db)
 {
     _verCollection = db.GetCollection <DbVersion>(settings.VersionCollectionName);
     _docId         = settings.VersionDocumentId;
     _lockerId      = Guid.NewGuid().ToString("N");
 }