MongoRepository documentation
MongoRepositoryManagerT Class |
Deals with the collections of entities in MongoDb. This class tries to hide as much MongoDb-specific details
as possible but it's not 100% *yet*. It is a very thin wrapper around most methods on MongoDb's MongoCollection
objects.
Inheritance Hierarchy
Namespace: MongoRepository
Assembly: MongoRepository.Net45 (in MongoRepository.Net45.dll) Version: 1.6.11.0 (1.6.11.0)
Syntax
public class MongoRepositoryManager<T> : MongoRepositoryManager<T, string>, IRepositoryManager<T>, IRepositoryManager<T, string> where T : Object, IEntity<string>
Public Class MongoRepositoryManager(Of T As {Object, IEntity(Of String)}) Inherits MongoRepositoryManager(Of T, String) Implements IRepositoryManager(Of T), IRepositoryManager(Of T, String)
generic<typename T> where T : Object, IEntity<String^> public ref class MongoRepositoryManager : public MongoRepositoryManager<T, String^>, IRepositoryManager<T>, IRepositoryManager<T, String^>
type MongoRepositoryManager<'T when 'T : Object and IEntity<string>> = class inherit MongoRepositoryManager<'T, string> interface IRepositoryManager<'T> interface IRepositoryManager<'T, string> end
Type Parameters
- T
- The type contained in the repository to manage.
The MongoRepositoryManagerT type exposes the following members.
Constructors
Name | Description | |
---|---|---|
MongoRepositoryManagerT |
Initializes a new instance of the MongoRepositoryManager class.
Uses the Default App/Web.Config connectionstrings to fetch the connectionString and Database name.
| |
MongoRepositoryManagerT(String) |
Initializes a new instance of the MongoRepositoryManager class.
| |
MongoRepositoryManagerT(String, String) |
Initializes a new instance of the MongoRepositoryManager class.
|
Properties
Name | Description | |
---|---|---|
Exists |
Gets a value indicating whether the collection already exists.
(Inherited from MongoRepositoryManagerT, TKey.) | |
Name |
Gets the name of the collection as Mongo uses.
(Inherited from MongoRepositoryManagerT, TKey.) |
Methods
Name | Description | |
---|---|---|
Drop |
Drops the collection.
(Inherited from MongoRepositoryManagerT, TKey.) | |
DropAllIndexes |
Drops all indexes on this repository.
(Inherited from MongoRepositoryManagerT, TKey.) | |
DropIndex |
Drops specified index on the repository.
(Inherited from MongoRepositoryManagerT, TKey.) | |
DropIndexes |
Drops specified indexes on the repository.
(Inherited from MongoRepositoryManagerT, TKey.) | |
EnsureIndex(String) |
Ensures that the desired index exist and creates it if it doesn't exist.
(Inherited from MongoRepositoryManagerT, TKey.) | |
EnsureIndex(String, Boolean, Boolean, Boolean) |
Ensures that the desired index exist and creates it if it doesn't exist.
(Inherited from MongoRepositoryManagerT, TKey.) | |
EnsureIndexes(IEnumerableString) |
Ensures that the desired indexes exist and creates them if they don't exist.
(Inherited from MongoRepositoryManagerT, TKey.) | |
EnsureIndexes(IMongoIndexKeys, IMongoIndexOptions) |
Ensures that the desired indexes exist and creates them if they don't exist.
(Inherited from MongoRepositoryManagerT, TKey.) | |
EnsureIndexes(IEnumerableString, Boolean, Boolean, Boolean) |
Ensures that the desired indexes exist and creates them if they don't exist.
(Inherited from MongoRepositoryManagerT, TKey.) | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetIndexes |
Gets the indexes for this repository.
(Inherited from MongoRepositoryManagerT, TKey.) | |
GetStats |
Gets stats for this repository.
(Inherited from MongoRepositoryManagerT, TKey.) | |
GetTotalDataSize | Obsolete.
Gets the total size for the repository (data + indexes).
(Inherited from MongoRepositoryManagerT, TKey.) | |
GetTotalStorageSize | Obsolete.
Gets the total storage size for the repository (data + indexes).
(Inherited from MongoRepositoryManagerT, TKey.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
IndexesExists |
Tests whether indexes exist.
(Inherited from MongoRepositoryManagerT, TKey.) | |
IndexExists |
Tests whether indexes exist.
(Inherited from MongoRepositoryManagerT, TKey.) | |
IsCapped |
Tests whether the repository is capped.
(Inherited from MongoRepositoryManagerT, TKey.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ReIndex |
Runs the ReIndex command on this repository.
(Inherited from MongoRepositoryManagerT, TKey.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Validate |
Validates the integrity of the repository.
(Inherited from MongoRepositoryManagerT, TKey.) |
Remarks
Entities are assumed to use strings for Id's.
See Also