Class MongoDataContext
A data context for MongoDB.
Inheritance
System.Object
System.Dynamic.DynamicObject
MongoDataContext
Implements
System.Dynamic.IDynamicMetaObjectProvider
System.IDisposable
Inherited Members
System.Dynamic.DynamicObject.GetMetaObject(System.Linq.Expressions.Expression)
System.Dynamic.DynamicObject.TryBinaryOperation(System.Dynamic.BinaryOperationBinder, System.Object, System.Object)
System.Dynamic.DynamicObject.TryConvert(System.Dynamic.ConvertBinder, System.Object)
System.Dynamic.DynamicObject.TryCreateInstance(System.Dynamic.CreateInstanceBinder, System.Object[], System.Object)
System.Dynamic.DynamicObject.TryDeleteIndex(System.Dynamic.DeleteIndexBinder, System.Object[])
System.Dynamic.DynamicObject.TryDeleteMember(System.Dynamic.DeleteMemberBinder)
System.Dynamic.DynamicObject.TryGetIndex(System.Dynamic.GetIndexBinder, System.Object[], System.Object)
System.Dynamic.DynamicObject.TryInvoke(System.Dynamic.InvokeBinder, System.Object[], System.Object)
System.Dynamic.DynamicObject.TrySetIndex(System.Dynamic.SetIndexBinder, System.Object[], System.Object)
System.Dynamic.DynamicObject.TryUnaryOperation(System.Dynamic.UnaryOperationBinder, System.Object)
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: Kephas.Data.MongoDB
Assembly: Kephas.Data.MongoDB.dll
Syntax
[SupportedDataStoreKinds(new DataStoreKind[]{DataStoreKind.MongoDB})]
public class MongoDataContext : DataContextBase, IDataContext, IContext, IExpando, IDynamicMetaObjectProvider, IIndexable, ILoggable, IIdentifiable, IDisposable, IInitializable
Constructors
| Improve this Doc View SourceMongoDataContext(ICompositionContext, IDataCommandProvider, IDataBehaviorProvider)
Initializes a new instance of the MongoDataContext class.
Declaration
public MongoDataContext(ICompositionContext compositionContext, IDataCommandProvider dataCommandProvider, IDataBehaviorProvider dataBehaviorProvider)
Parameters
Type | Name | Description |
---|---|---|
ICompositionContext | compositionContext | The composition context. |
IDataCommandProvider | dataCommandProvider | The data command provider. |
IDataBehaviorProvider | dataBehaviorProvider | The data behavior provider. |
Properties
| Improve this Doc View SourceClient
Gets the MongoDB client.
Declaration
public IMongoClient Client { get; }
Property Value
Type | Description |
---|---|
MongoDB.Driver.IMongoClient | The MongoDB client. |
Database
Gets the MongoDB database.
Declaration
public IMongoDatabase Database { get; }
Property Value
Type | Description |
---|---|
MongoDB.Driver.IMongoDatabase | The MongoDB database. |
Methods
| Improve this Doc View SourceGetCollectionName(Type)
Gets the collection name for the provided entity type.
Declaration
protected virtual string GetCollectionName(Type entityType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | entityType | Type of the entity. |
Returns
Type | Description |
---|---|
System.String | The collection name. |
Initialize(IDataInitializationContext)
Initializes the MongoDataContext.
Declaration
protected override void Initialize(IDataInitializationContext dataInitializationContext)
Parameters
Type | Name | Description |
---|---|---|
IDataInitializationContext | dataInitializationContext | The data initialization context. |
Overrides
| Improve this Doc View SourceQueryCore<T>(IQueryOperationContext)
Gets a query over the entity type for the given query operation context, if any is provided.
Declaration
protected override IQueryable<T> QueryCore<T>(IQueryOperationContext queryOperationContext)
where T : class
Parameters
Type | Name | Description |
---|---|---|
IQueryOperationContext | queryOperationContext | Context for the query. |
Returns
Type | Description |
---|---|
System.Linq.IQueryable<T> | A query over the entity type. |
Type Parameters
Name | Description |
---|---|
T | The entity type. |
Overrides
Implements
System.Dynamic.IDynamicMetaObjectProvider
System.IDisposable