public VersionMongoRepository(IConnect connect, string collectionName = null, ISnapshotFreqPolicy snapshotFreqPolicy = null) { this.Connect = connect; if (string.IsNullOrEmpty(collectionName)) { CollectionNameAttribute mongoCollectionName = (CollectionNameAttribute)typeof(T).GetTypeInfo().GetCustomAttribute(typeof(CollectionNameAttribute)); this.CollectionName = (mongoCollectionName != null ? mongoCollectionName.Name : typeof(T).Name.ToLower()); mongoCollectionName = null; } else { this.CollectionName = collectionName; } this.OriginalCollection = this.Connect.Collection <T>(this.CollectionName); this.SnapshotFreqPolicy = snapshotFreqPolicy ?? new SnapshotFreqPolicy.MonthSnapshot(); }
public VersionMongoRepository(MongoUrl url, string collectionName = null, ISnapshotFreqPolicy snapshotFreqPolicy = null) : this(new Connect(url), collectionName, snapshotFreqPolicy) { }
public VersionMongoRepository(string connectionString, string databaseName, string collectionName = null, ISnapshotFreqPolicy snapshotFreqPolicy = null) : this(new Connect(connectionString, databaseName), collectionName, snapshotFreqPolicy) { }