Search Results for

    Show / Hide Table of Contents

    Class MongoContext

    Mongo context

    Inheritance
    System.Object
    MongoContext
    Implements
    IMongoContext
    IDatabaseContext
    System.IDisposable
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Simplic.Data.MongoDB
    Assembly: Simplic.Data.MongoDB.dll
    Syntax
    public class MongoContext : IMongoContext, IDatabaseContext, IDisposable

    Constructors

    | Improve this Doc View Source

    MongoContext(IConnectionConfigurationService)

    Declaration
    public MongoContext(IConnectionConfigurationService configurationService)
    Parameters
    Type Name Description
    IConnectionConfigurationService configurationService

    Properties

    | Improve this Doc View Source

    EnableTransactions

    Gets or sets whether transactions are allowed or not

    Declaration
    public bool EnableTransactions { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    MongoClient

    Gets the mongo client instance

    Declaration
    public MongoClient MongoClient { get; }
    Property Value
    Type Description
    MongoClient
    | Improve this Doc View Source

    Session

    Gets or sets the client session handle

    Declaration
    public IClientSessionHandle Session { get; set; }
    Property Value
    Type Description
    IClientSessionHandle

    Methods

    | Improve this Doc View Source

    AddCommand(Func<Task>)

    Declaration
    public void AddCommand(Func<Task> func)
    Parameters
    Type Name Description
    System.Func<System.Threading.Tasks.Task> func
    | Improve this Doc View Source

    Dispose()

    Dispose context

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    GetCollection<T>(String)

    Get mongodb collection

    Declaration
    public IMongoCollection<T> GetCollection<T>(string name)
    Parameters
    Type Name Description
    System.String name

    Collection name

    Returns
    Type Description
    IMongoCollection<T>

    Collection instance

    Type Parameters
    Name Description
    T

    Entity type

    | Improve this Doc View Source

    SaveChangesAsync()

    Declaration
    public async Task<int> SaveChangesAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task<System.Int32>
    | Improve this Doc View Source

    SetConfiguration(String)

    Set database configuration by name

    Declaration
    public void SetConfiguration(string configurationName)
    Parameters
    Type Name Description
    System.String configurationName

    Implements

    IMongoContext
    IDatabaseContext
    System.IDisposable
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2018 SIMPLIC GmbH
    Generated by DocFx