Class MongoDbRepository<T>
Provides access to basic operations for MongoDB.
To use this code, mongo database must run somewhere. To start MongoDB locally you can use following code
Start MongoDB without authentication
"C:\Program Files\MongoDB\Server\4.4\bin\mongod.exe" --dbpath C:\DATA\DB446\
Start MongoDB with authentication. You don't have to use the "--port" attribute or use a different "--dbpath". The only
reason why would you want to run authenticated database on a different dbpath and port simultaneously is if they're running
on the same machine.
More info about the use credentials MongoDbCredentials
"C:\Program Files\MongoDB\Server\4.4\bin\mongod.exe" --dbpath C:\DATA\DB446_AUTH\ --auth --port 27018
Inheritance
System.Object
MongoDbRepository<T>
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()
Assembly: TcOpen.Inxton.MongoDb.dll
Syntax
public class MongoDbRepository<T> : RepositoryBase<T>, IRepository<T>, IRepository where T : IBrowsableDataObject
Type Parameters
Constructors
|
Improve this Doc
View Source
MongoDbRepository(MongoDbRepositorySettings<T>)
Declaration
public MongoDbRepository(MongoDbRepositorySettings<T> parameters)
Parameters
Fields
|
Improve this Doc
View Source
collection
Declaration
IMongoCollection<T> collection
Field Value
Type |
Description |
MongoDB.Driver.IMongoCollection<T> |
|
|
Improve this Doc
View Source
location
Declaration
Field Value
Type |
Description |
System.String |
|
Properties
|
Improve this Doc
View Source
Collection
Gets the MongoDB.Driver.IMongoCollection<TDocument> of this repository.
Declaration
public IMongoCollection<T> Collection { get; }
Property Value
Type |
Description |
MongoDB.Driver.IMongoCollection<T> |
|
|
Improve this Doc
View Source
CountNvi
Declaration
protected override long CountNvi { get; }
Property Value
Type |
Description |
System.Int64 |
|
Overrides
TcOpen.Inxton.Data.RepositoryBase<T>.CountNvi
|
Improve this Doc
View Source
Queryable
Declaration
public override IQueryable<T> Queryable { get; }
Property Value
Type |
Description |
System.Linq.IQueryable<T> |
|
Overrides
TcOpen.Inxton.Data.RepositoryBase<T>.Queryable
Methods
|
Improve this Doc
View Source
CreateNvi(String, T)
Declaration
protected override void CreateNvi(string identifier, T data)
Parameters
Type |
Name |
Description |
System.String |
identifier |
|
T |
data |
|
Overrides
TcOpen.Inxton.Data.RepositoryBase<T>.CreateNvi(System.String, T)
|
Improve this Doc
View Source
DeleteNvi(String)
Declaration
protected override void DeleteNvi(string identifier)
Parameters
Type |
Name |
Description |
System.String |
identifier |
|
Overrides
TcOpen.Inxton.Data.RepositoryBase<T>.DeleteNvi(System.String)
|
Improve this Doc
View Source
ExistsNvi(String)
Declaration
protected override bool ExistsNvi(string identifier)
Parameters
Type |
Name |
Description |
System.String |
identifier |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
TcOpen.Inxton.Data.RepositoryBase<T>.ExistsNvi(System.String)
|
Improve this Doc
View Source
FilteredCountNvi(String, eSearchMode)
Declaration
protected override long FilteredCountNvi(string id, eSearchMode searchMode)
Parameters
Type |
Name |
Description |
System.String |
id |
|
eSearchMode |
searchMode |
|
Returns
Type |
Description |
System.Int64 |
|
Overrides
TcOpen.Inxton.Data.RepositoryBase<T>.FilteredCountNvi(System.String, TcOpen.Inxton.Data.eSearchMode)
|
Improve this Doc
View Source
GetRecordsNvi(String, Int32, Int32, eSearchMode)
Declaration
protected override IEnumerable<T> GetRecordsNvi(string identifier, int limit, int skip, eSearchMode searchMode)
Parameters
Type |
Name |
Description |
System.String |
identifier |
|
System.Int32 |
limit |
|
System.Int32 |
skip |
|
eSearchMode |
searchMode |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<T> |
|
Overrides
TcOpen.Inxton.Data.RepositoryBase<T>.GetRecordsNvi(System.String, System.Int32, System.Int32, TcOpen.Inxton.Data.eSearchMode)
|
Improve this Doc
View Source
ParseIdentifierForRegularExpression(String)
Parses input string, so it is evaluated as verbatim string and not as regular expression. All special ascii characters are prefixed with "".
Declaration
string ParseIdentifierForRegularExpression(string identifier)
Parameters
Type |
Name |
Description |
System.String |
identifier |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
ReadNvi(String)
Declaration
protected override T ReadNvi(string identifier)
Parameters
Type |
Name |
Description |
System.String |
identifier |
|
Returns
Overrides
TcOpen.Inxton.Data.RepositoryBase<T>.ReadNvi(System.String)
|
Improve this Doc
View Source
RecordExists(String)
Declaration
bool RecordExists(string identifier)
Parameters
Type |
Name |
Description |
System.String |
identifier |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
UpdateNvi(String, T)
Declaration
protected override void UpdateNvi(string identifier, T data)
Parameters
Type |
Name |
Description |
System.String |
identifier |
|
T |
data |
|
Overrides
TcOpen.Inxton.Data.RepositoryBase<T>.UpdateNvi(System.String, T)
Implements