/// <summary> /// Initializes a new instance of <see cref="EntityContext{T}"/> /// </summary> /// <param name="connection"></param> public EntityContext(EntityContextConnection connection) { _connection = connection; _collectionName = typeof(T).Name; _collection = _connection.Database.GetCollection <T>(_collectionName); }
/// <summary> /// Initializes a new instance of <see cref="EntityContext{T}"/> /// </summary> /// <param name="connection"></param> /// <param name="classMaps"></param> public EntityContext(EntityContextConnection connection, IInstancesOf <BsonClassMap> classMaps) { _connection = connection; _collectionName = typeof(T).Name; _collection = _connection.Database.GetCollection <T>(_collectionName); RegisterClassMapsIfNotRegistered(classMaps); }