Search Results for

    Show / Hide Table of Contents

    Class MongoReadOnlyRepositoryBase<TId, TDocument, TFilter>

    Base implementation of a mongo db read only repository.

    Inheritance
    System.Object
    MongoReadOnlyRepositoryBase<TId, TDocument, TFilter>
    MongoRepositoryBase<TId, TDocument, TFilter>
    Implements
    IReadOnlyRepository<TId, TDocument, TFilter>
    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 abstract class MongoReadOnlyRepositoryBase<TId, TDocument, TFilter> : IReadOnlyRepository<TId, TDocument, TFilter>, IDisposable where TDocument : IDocument<TId> where TFilter : IFilter<TId>, new()
    Type Parameters
    Name Description
    TId

    The type of the id.

    TDocument

    The type of the document.

    TFilter

    The type of the filter.

    Constructors

    | Improve this Doc View Source

    MongoReadOnlyRepositoryBase(IMongoContext)

    Initializes a new instance of MongoReadOnlyRepositoryBase<TId, TDocument, TFilter>.

    Declaration
    protected MongoReadOnlyRepositoryBase(IMongoContext context)
    Parameters
    Type Name Description
    IMongoContext context
    | Improve this Doc View Source

    MongoReadOnlyRepositoryBase(IMongoContext, String)

    Initializes a new instance of MongoReadOnlyRepositoryBase<TId, TDocument, TFilter>

    Declaration
    protected MongoReadOnlyRepositoryBase(IMongoContext context, string configurationKey)
    Parameters
    Type Name Description
    IMongoContext context
    System.String configurationKey

    Fields

    | Improve this Doc View Source

    Collection

    Getss the collection.

    Declaration
    protected IMongoCollection<TDocument> Collection
    Field Value
    Type Description
    IMongoCollection<TDocument>
    | Improve this Doc View Source

    Context

    Gets the context.

    Declaration
    protected readonly IMongoContext Context
    Field Value
    Type Description
    IMongoContext

    Methods

    | Improve this Doc View Source

    BuildFilterQuery(TFilter)

    Builds a filter query.

    Declaration
    protected FilterDefinition<TDocument> BuildFilterQuery(TFilter filter)
    Parameters
    Type Name Description
    TFilter filter

    A filter.

    Returns
    Type Description
    FilterDefinition<TDocument>

    A filter definition for the document.

    | Improve this Doc View Source

    Dispose()

    Disposes the context.

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

    FindAsync(TFilter, Nullable<Int32>, Nullable<Int32>, String, Boolean)

    Finds the documents matching the filter.

    Declaration
    public virtual async Task<IEnumerable<TDocument>> FindAsync(TFilter predicate, int? skip, int? limit, string sortField = "", bool isAscending = true)
    Parameters
    Type Name Description
    TFilter predicate

    The filter predicate

    System.Nullable<System.Int32> skip

    Number of skipped entities

    System.Nullable<System.Int32> limit

    Number of requested entities

    System.String sortField

    Sort field

    System.Boolean isAscending

    Ascending or Descending sort

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<TDocument>>

    TDocument entities matching the search criteria

    | Improve this Doc View Source

    GetAllAsync()

    Get all entities from data source

    Declaration
    public virtual async Task<IEnumerable<TDocument>> GetAllAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<TDocument>>

    Enumerable of entities

    | Improve this Doc View Source

    GetAsync(TId)

    Get an entity by its id

    Declaration
    public virtual async Task<TDocument> GetAsync(TId id)
    Parameters
    Type Name Description
    TId id
    Returns
    Type Description
    System.Threading.Tasks.Task<TDocument>

    Entity

    | Improve this Doc View Source

    GetByFilterAsync(TFilter)

    Get entities by filter

    Declaration
    public virtual async Task<IEnumerable<TDocument>> GetByFilterAsync(TFilter filter)
    Parameters
    Type Name Description
    TFilter filter
    Returns
    Type Description
    System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<TDocument>>

    Enumerable of entities

    | Improve this Doc View Source

    GetCollectionName()

    Gets the collection name.

    Declaration
    protected virtual string GetCollectionName()
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    GetFilterQueries(TFilter)

    Gets an enumerable of filter definitions.

    Declaration
    protected virtual IEnumerable<FilterDefinition<TDocument>> GetFilterQueries(TFilter filter)
    Parameters
    Type Name Description
    TFilter filter

    A filter.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<FilterDefinition<TDocument>>

    A list of filter definitions.

    | Improve this Doc View Source

    Initialize()

    Initializes a new collection.

    Declaration
    protected async Task Initialize()
    Returns
    Type Description
    System.Threading.Tasks.Task

    Implements

    IReadOnlyRepository<TId, TDocument, TFilter>
    System.IDisposable
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2018 SIMPLIC GmbH
    Generated by DocFx