Class MongoClientAccessor
Accesses Mongo DB default singleton client of the app context
Inheritance
System.Object
MongoClientAccessor
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Azos.Data.Access.MongoDb.Connector
Assembly: Azos.MongoDb.dll
Syntax
public static class MongoClientAccessor
Methods
GetDefaultMongoClient(IApplication)
Accesses default mongo client singleton of app context - it is lazily created
Declaration
public static MongoClient GetDefaultMongoClient(this IApplication app)
Parameters
Type | Name | Description |
---|---|---|
IApplication | app |
Returns
Type | Description |
---|---|
MongoClient |
GetMongoDatabaseFromConnectString(IApplication, String)
Return a Database instance per supplied connection string in the following form:
mongo{server="mongo://localhost:27017" db="myDB"}
Declaration
public static Database GetMongoDatabaseFromConnectString(this IApplication app, string cString)
Parameters
Type | Name | Description |
---|---|---|
IApplication | app | |
System.String | cString |
Returns
Type | Description |
---|---|
Database |