Merge pull request #23 from DanielGasson/master
Allow initialisation of MongoDbContext with connection string only
This commit is contained in:
@@ -46,6 +46,15 @@ namespace MongoDbGenericRepository
|
|||||||
Database = Client.GetDatabase(databaseName);
|
Database = Client.GetDatabase(databaseName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initialise an instance of a <see cref="IMongoDbContext"/> using a connection string
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="connectionString"></param>
|
||||||
|
public MongoDbContext(string connectionString)
|
||||||
|
: this(connectionString, new MongoUrl(connectionString).DatabaseName)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The constructor of the MongoDbContext, it needs a connection string and a database name.
|
/// The constructor of the MongoDbContext, it needs a connection string and a database name.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user