MongoRepository(T) Class

MongoRepository

MongoRepositoryT Class
Deals with entities in MongoDb.
Inheritance Hierarchy
SystemObject  MongoRepositoryMongoRepositoryT, String
    MongoRepositoryMongoRepositoryT

Namespace: MongoRepository
Assembly: MongoRepository.Net45 (in MongoRepository.Net45.dll) Version: 1.6.11.0 (1.6.11.0)
Syntax
public class MongoRepository<T> : MongoRepository<T, string>, 
	IRepository<T>, IRepository<T, string>, IQueryable<T>, IEnumerable<T>, 
	IQueryable, IEnumerable
where T : Object, IEntity<string>
Public Class MongoRepository(Of T As {Object, IEntity(Of String)})
	Inherits MongoRepository(Of T, String)
	Implements IRepository(Of T), IRepository(Of T, String), 
	IQueryable(Of T), IEnumerable(Of T), IQueryable, IEnumerable
generic<typename T>
where T : Object, IEntity<String^>
public ref class MongoRepository : public MongoRepository<T, String^>, 
	IRepository<T>, IRepository<T, String^>, IQueryable<T>, IEnumerable<T>, 
	IQueryable, IEnumerable
type MongoRepository<'T when 'T : Object and IEntity<string>> =  
    class
        inherit MongoRepository<'T, string>
        interface IRepository<'T>
        interface IRepository<'T, string>
        interface IQueryable<'T>
        interface IEnumerable<'T>
        interface IQueryable
        interface IEnumerable
    end

Type Parameters

T
The type contained in the repository.

The MongoRepositoryT type exposes the following members.

Constructors
  NameDescription
Public methodMongoRepositoryT
Initializes a new instance of the MongoRepository class. Uses the Default App/Web.Config connectionstrings to fetch the connectionString and Database name.
Public methodMongoRepositoryT(MongoUrl)
Initializes a new instance of the MongoRepository class.
Public methodMongoRepositoryT(String)
Initializes a new instance of the MongoRepository class.
Public methodMongoRepositoryT(MongoUrl, String)
Initializes a new instance of the MongoRepository class.
Public methodMongoRepositoryT(String, String)
Initializes a new instance of the MongoRepository class.
Top
Properties
  NameDescription
Public propertyCollection
Gets the Mongo collection (to perform advanced operations).
(Inherited from MongoRepositoryT, TKey.)
Public propertyCollectionName
Gets the name of the collection
(Inherited from MongoRepositoryT, TKey.)
Public propertyElementType
Gets the type of the element(s) that are returned when the expression tree associated with this instance of IQueryable is executed.
(Inherited from MongoRepositoryT, TKey.)
Public propertyExpression
Gets the expression tree that is associated with the instance of IQueryable.
(Inherited from MongoRepositoryT, TKey.)
Public propertyProvider
Gets the query provider that is associated with this data source.
(Inherited from MongoRepositoryT, TKey.)
Top
Methods
  NameDescription
Public methodAdd(IEnumerableT)
Adds the new entities in the repository.
(Inherited from MongoRepositoryT, TKey.)
Public methodAdd(T)
Adds the new entity in the repository.
(Inherited from MongoRepositoryT, TKey.)
Public methodCount
Counts the total entities in the repository.
(Inherited from MongoRepositoryT, TKey.)
Public methodDelete(ObjectId)
Deletes an entity from the repository by its ObjectId.
(Inherited from MongoRepositoryT, TKey.)
Public methodDelete(ExpressionFuncT, Boolean)
Deletes the entities matching the predicate.
(Inherited from MongoRepositoryT, TKey.)
Public methodDelete(TKey)
Deletes an entity from the repository by its id.
(Inherited from MongoRepositoryT, TKey.)
Public methodDeleteAll
Deletes all entities in the repository.
(Inherited from MongoRepositoryT, TKey.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExists
Checks if the entity exists for given predicate.
(Inherited from MongoRepositoryT, TKey.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetById(ObjectId)
Returns the T by its given id.
(Inherited from MongoRepositoryT, TKey.)
Public methodGetById(TKey)
Returns the T by its given id.
(Inherited from MongoRepositoryT, TKey.)
Public methodGetEnumerator
Returns an enumerator that iterates through a collection.
(Inherited from MongoRepositoryT, TKey.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRequestDone
Lets the server know that this thread is done with a series of related operations.
(Inherited from MongoRepositoryT, TKey.)
Public methodRequestStart
Lets the server know that this thread is about to begin a series of related operations that must all occur on the same connection. The return value of this method implements IDisposable and can be placed in a using statement (in which case RequestDone will be called automatically when leaving the using statement).
(Inherited from MongoRepositoryT, TKey.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUpdate(IEnumerableT)
Upserts the entities.
(Inherited from MongoRepositoryT, TKey.)
Public methodUpdate(T)
Upserts an entity.
(Inherited from MongoRepositoryT, TKey.)
Top
Fields
  NameDescription
Protected fieldcollection
MongoCollection field.
(Inherited from MongoRepositoryT, TKey.)
Top
Remarks
Entities are assumed to use strings for Id's.
See Also