Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8d6b796e7f | |||
| 1a7763a312 | |||
| 77cc85574c | |||
| 846bb16730 | |||
| 5e4cbfa1b3 | |||
| 804dc18c4f | |||
| 182ee0a335 | |||
| bd662d25d6 | |||
| 6c8d4bdafb | |||
| 4d94a1b436 | |||
| d91a644b4a | |||
| 9d1950e9c7 | |||
| 67d0a4c8a3 | |||
| 1826668cea |
@@ -9,7 +9,7 @@
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="2.1.2" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
|
||||
<PackageReference Include="MongoDB.Driver" Version="2.7.0" />
|
||||
<PackageReference Include="MongoDbGenericRepository" Version="1.3.9" />
|
||||
<PackageReference Include="MongoDbGenericRepository" Version="1.4.0" />
|
||||
<PackageReference Include="xunit" Version="2.4.0" />
|
||||
<PackageReference Include="xunit.runner.console" Version="2.4.0" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace MongoDbGenericRepository
|
||||
{
|
||||
private readonly object _initLock = new object();
|
||||
private MongoDbCreator _mongoDbCreator;
|
||||
protected MongoDbCreator MongoDbCreator
|
||||
protected virtual MongoDbCreator MongoDbCreator
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -77,6 +77,7 @@ namespace MongoDbGenericRepository
|
||||
|
||||
return _mongoDbCreator;
|
||||
}
|
||||
set { _mongoDbCreator = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace MongoDbGenericRepository
|
||||
public abstract partial class BaseMongoRepository : IBaseMongoRepository_Delete
|
||||
{
|
||||
private MongoDbEraser _mongoDbEraser;
|
||||
protected MongoDbEraser MongoDbEraser
|
||||
protected virtual MongoDbEraser MongoDbEraser
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -121,6 +121,7 @@ namespace MongoDbGenericRepository
|
||||
|
||||
return _mongoDbEraser;
|
||||
}
|
||||
set { _mongoDbEraser = value; }
|
||||
}
|
||||
|
||||
#region Delete
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace MongoDbGenericRepository
|
||||
public abstract partial class BaseMongoRepository : IBaseMongoRepository_Index
|
||||
{
|
||||
private MongoDbIndexHandler _mongoDbIndexHandler;
|
||||
protected MongoDbIndexHandler MongoDbIndexHandler
|
||||
protected virtual MongoDbIndexHandler MongoDbIndexHandler
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -128,6 +128,7 @@ namespace MongoDbGenericRepository
|
||||
}
|
||||
return _mongoDbIndexHandler;
|
||||
}
|
||||
set { _mongoDbIndexHandler = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -316,4 +317,4 @@ namespace MongoDbGenericRepository
|
||||
await MongoDbIndexHandler.DropIndexAsync<TDocument, TKey>(indexName, partitionKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace MongoDbGenericRepository
|
||||
public abstract partial class BaseMongoRepository : IBaseMongoRepository_Update
|
||||
{
|
||||
private MongoDbUpdater _mongoDbUpdater;
|
||||
protected MongoDbUpdater MongoDbUpdater
|
||||
protected virtual MongoDbUpdater MongoDbUpdater
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -156,6 +156,7 @@ namespace MongoDbGenericRepository
|
||||
|
||||
return _mongoDbUpdater;
|
||||
}
|
||||
set { _mongoDbUpdater = value; }
|
||||
}
|
||||
|
||||
#region Update
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace MongoDbGenericRepository
|
||||
/// <summary>
|
||||
/// The MongoDb accessor to insert data.
|
||||
/// </summary>
|
||||
protected MongoDbCreator MongoDbCreator
|
||||
protected virtual MongoDbCreator MongoDbCreator
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -72,6 +72,7 @@ namespace MongoDbGenericRepository
|
||||
}
|
||||
return _mongoDbCreator;
|
||||
}
|
||||
set { _mongoDbCreator = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace MongoDbGenericRepository
|
||||
/// <summary>
|
||||
/// The MongoDb accessor to delete data.
|
||||
/// </summary>
|
||||
protected MongoDbEraser MongoDbEraser
|
||||
protected virtual MongoDbEraser MongoDbEraser
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -113,6 +113,7 @@ namespace MongoDbGenericRepository
|
||||
}
|
||||
return _mongoDbEraser;
|
||||
}
|
||||
set { _mongoDbEraser = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace MongoDbGenericRepository
|
||||
/// <summary>
|
||||
/// The MongoDb accessor to manage indexes.
|
||||
/// </summary>
|
||||
protected MongoDbIndexHandler MongoDbIndexHandler
|
||||
protected virtual MongoDbIndexHandler MongoDbIndexHandler
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -124,6 +124,7 @@ namespace MongoDbGenericRepository
|
||||
}
|
||||
return _mongoDbIndexHandler;
|
||||
}
|
||||
set { _mongoDbIndexHandler = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace MongoDbGenericRepository
|
||||
where TKey : IEquatable<TKey>
|
||||
{
|
||||
private MongoDbUpdater _mongoDbUpdater;
|
||||
protected MongoDbUpdater MongoDbUpdater
|
||||
protected virtual MongoDbUpdater MongoDbUpdater
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -132,6 +132,7 @@ namespace MongoDbGenericRepository
|
||||
|
||||
return _mongoDbUpdater;
|
||||
}
|
||||
set { _mongoDbUpdater = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<package >
|
||||
<metadata>
|
||||
<id>MongoDbGenericRepository</id>
|
||||
<version>1.3.9</version>
|
||||
<version>1.4.0</version>
|
||||
<title>MongoDb Generic Repository</title>
|
||||
<authors>Alexandre Spieser</authors>
|
||||
<owners>Alexandre Spieser</owners>
|
||||
|
||||
Binary file not shown.
@@ -1085,7 +1085,7 @@
|
||||
"DnsClient/1.0.7": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-f3k5ufhUSL658fy/ac1mReqRIr0jGMyOJFvBqJ+7cASq01NIysYbrrRDjboYKAGrd0Y2mc1A749uQvT8vAA91A==",
|
||||
"sha512": "sha512-i6Imdyz+dvljMtQh1QtjMzguLEFFJCilecHiaRPIbNX4gK3zluf/3OQWD1XbVy5PXf1u394x5ImB+uu7DNMS1w==",
|
||||
"path": "dnsclient/1.0.7",
|
||||
"hashPath": "dnsclient.1.0.7.nupkg.sha512"
|
||||
},
|
||||
@@ -1113,28 +1113,28 @@
|
||||
"Microsoft.Win32.Registry/4.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-mYUxH/YY9PwvuWY93/qsovFHAh+Lu2CNxNHWxB/x0dnpaEy6oIy/9d7R2J6dFaLZ7jhE7emLjn7A8kSzsP1A+Q==",
|
||||
"sha512": "sha512-UiSp7lTxGtsF6J96wwErFeM0jygj/bWWKvbqwtRP2t6OohgT7TCTpjvQ1+7DLQLH3DR70i6+eRGX/y85WFuz1Q==",
|
||||
"path": "microsoft.win32.registry/4.0.0",
|
||||
"hashPath": "microsoft.win32.registry.4.0.0.nupkg.sha512"
|
||||
},
|
||||
"MongoDB.Bson/2.7.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-vzpTDHYX/X6gF9qtDuKRJiLkqpj5OZuT1bIzJCiBiU8CwJ37becYmaXuy/QSuWnYN6j6ZdVTWILKbWt2MXL8DA==",
|
||||
"sha512": "sha512-BBPKyeYmhRduXuDQsFvB2bw34rAqJrT9UZPHAVLGLtvp5wYxhzP8r7SrSn//f91Xst09Ww/5lq3DD5byn0fdLw==",
|
||||
"path": "mongodb.bson/2.7.0",
|
||||
"hashPath": "mongodb.bson.2.7.0.nupkg.sha512"
|
||||
},
|
||||
"MongoDB.Driver/2.7.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-5wP5BBwm5YO6h2Vhw6zQmOwSW9WP2d6kgRM6E7uIbwIJz4+j2trS2Wo7/+IYow5WVN8Jd6O27bIB/4gKNepO1Q==",
|
||||
"sha512": "sha512-HcifZthdICkC5oXnIrxH8TJTDc8JMym+X1NR/oJjcDm841fkvSvg1MEL8LNu/FLlwQQq3XxtrxKGDvTT/z1RmA==",
|
||||
"path": "mongodb.driver/2.7.0",
|
||||
"hashPath": "mongodb.driver.2.7.0.nupkg.sha512"
|
||||
},
|
||||
"MongoDB.Driver.Core/2.7.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-SepB4KT+zXA3iFaIFwXVKmk6BZIp0EGE/iWqNbDZ1mca9e8EhtqYPwOOzFmEbdKAzmVvF1y86kNI4agWP6I5sg==",
|
||||
"sha512": "sha512-oPlQUCdysl9AL9TlTDsadrjWbiZDSbl6N4AGAe04gY2qYsJ9r7Pu5+TvFf7epAl3tOt6art3/maOhg7KL2vDng==",
|
||||
"path": "mongodb.driver.core/2.7.0",
|
||||
"hashPath": "mongodb.driver.core.2.7.0.nupkg.sha512"
|
||||
},
|
||||
@@ -1323,7 +1323,7 @@
|
||||
"System.Diagnostics.Process/4.1.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-4dlFhzwmI3hl32P+8c9hnytYtV7Xldhsokm5i7Fvv5PmTS68TQCfsuJrREIyF9N1B8zlsSomp7AVrXLe45kKFQ==",
|
||||
"sha512": "sha512-S2YC+MwpWZ6e7h2lqNce/ubMjD4vf2Ea/uOEncYNH1/fFXaXlKDM9ig/zCE1rR+wwYzE8FXtvj+1Nymh6oZ9bg==",
|
||||
"path": "system.diagnostics.process/4.1.0",
|
||||
"hashPath": "system.diagnostics.process.4.1.0.nupkg.sha512"
|
||||
},
|
||||
@@ -1337,7 +1337,7 @@
|
||||
"System.Diagnostics.TraceSource/4.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-bGUeY5wiCHYSWbYZS3QjbaQ1hNoJ1RQBQMB3E0Cgh6AH//4rXfXIOHKIW46HDOsTEDoNfvFNDXphL5W5B/XMwQ==",
|
||||
"sha512": "sha512-q5bGzzvXVi+dIMiPWRhXZV7r+Os3TEOuRW5LHsAUDGpqJHol8XiLokVpsgAfPqHHNkyx1bbv5lRZqRkRrGZKxQ==",
|
||||
"path": "system.diagnostics.tracesource/4.0.0",
|
||||
"hashPath": "system.diagnostics.tracesource.4.0.0.nupkg.sha512"
|
||||
},
|
||||
@@ -1463,7 +1463,7 @@
|
||||
"System.Net.Security/4.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-iavC4j5XrRyX3aXbn23jHHF0NTxw9F+2vi3a94VY4BgfrYm5VQBh8OzU1TkNahTSlcKzjGhEc7ZfTfe4b62J6Q==",
|
||||
"sha512": "sha512-e7y/92A7436wJ33VOnUf5XbIlubGgHH7+cODaQkeYwU0xXd/fB/j6KiOdS6VvHcRfBXUYIPsvBOdz3WSNE1siQ==",
|
||||
"path": "system.net.security/4.0.0",
|
||||
"hashPath": "system.net.security.4.0.0.nupkg.sha512"
|
||||
},
|
||||
@@ -1666,7 +1666,7 @@
|
||||
"System.Threading.Overlapped/4.3.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-JpukcZA7kre2gQ7GrhtvZu1xv/LVEG5HV9AajQ3XV7l36T6ICalw/llfkBHeK/eqo8UWpMNqkWGCzzlSuqE6pg==",
|
||||
"sha512": "sha512-JWEtWIoYBHzMmgt2I/1e4FFG6veDL4yzA1Y7iuEY2G+GyZyrzqx/GQlM92M+d81D1cH2dp2KRhbZdQebn8Q+RA==",
|
||||
"path": "system.threading.overlapped/4.3.0",
|
||||
"hashPath": "system.threading.overlapped.4.3.0.nupkg.sha512"
|
||||
},
|
||||
|
||||
Binary file not shown.
@@ -984,7 +984,7 @@
|
||||
"DnsClient/1.0.7": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-f3k5ufhUSL658fy/ac1mReqRIr0jGMyOJFvBqJ+7cASq01NIysYbrrRDjboYKAGrd0Y2mc1A749uQvT8vAA91A==",
|
||||
"sha512": "sha512-i6Imdyz+dvljMtQh1QtjMzguLEFFJCilecHiaRPIbNX4gK3zluf/3OQWD1XbVy5PXf1u394x5ImB+uu7DNMS1w==",
|
||||
"path": "dnsclient/1.0.7",
|
||||
"hashPath": "dnsclient.1.0.7.nupkg.sha512"
|
||||
},
|
||||
@@ -1012,28 +1012,28 @@
|
||||
"Microsoft.Win32.Registry/4.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-mYUxH/YY9PwvuWY93/qsovFHAh+Lu2CNxNHWxB/x0dnpaEy6oIy/9d7R2J6dFaLZ7jhE7emLjn7A8kSzsP1A+Q==",
|
||||
"sha512": "sha512-UiSp7lTxGtsF6J96wwErFeM0jygj/bWWKvbqwtRP2t6OohgT7TCTpjvQ1+7DLQLH3DR70i6+eRGX/y85WFuz1Q==",
|
||||
"path": "microsoft.win32.registry/4.0.0",
|
||||
"hashPath": "microsoft.win32.registry.4.0.0.nupkg.sha512"
|
||||
},
|
||||
"MongoDB.Bson/2.7.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-vzpTDHYX/X6gF9qtDuKRJiLkqpj5OZuT1bIzJCiBiU8CwJ37becYmaXuy/QSuWnYN6j6ZdVTWILKbWt2MXL8DA==",
|
||||
"sha512": "sha512-BBPKyeYmhRduXuDQsFvB2bw34rAqJrT9UZPHAVLGLtvp5wYxhzP8r7SrSn//f91Xst09Ww/5lq3DD5byn0fdLw==",
|
||||
"path": "mongodb.bson/2.7.0",
|
||||
"hashPath": "mongodb.bson.2.7.0.nupkg.sha512"
|
||||
},
|
||||
"MongoDB.Driver/2.7.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-5wP5BBwm5YO6h2Vhw6zQmOwSW9WP2d6kgRM6E7uIbwIJz4+j2trS2Wo7/+IYow5WVN8Jd6O27bIB/4gKNepO1Q==",
|
||||
"sha512": "sha512-HcifZthdICkC5oXnIrxH8TJTDc8JMym+X1NR/oJjcDm841fkvSvg1MEL8LNu/FLlwQQq3XxtrxKGDvTT/z1RmA==",
|
||||
"path": "mongodb.driver/2.7.0",
|
||||
"hashPath": "mongodb.driver.2.7.0.nupkg.sha512"
|
||||
},
|
||||
"MongoDB.Driver.Core/2.7.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-SepB4KT+zXA3iFaIFwXVKmk6BZIp0EGE/iWqNbDZ1mca9e8EhtqYPwOOzFmEbdKAzmVvF1y86kNI4agWP6I5sg==",
|
||||
"sha512": "sha512-oPlQUCdysl9AL9TlTDsadrjWbiZDSbl6N4AGAe04gY2qYsJ9r7Pu5+TvFf7epAl3tOt6art3/maOhg7KL2vDng==",
|
||||
"path": "mongodb.driver.core/2.7.0",
|
||||
"hashPath": "mongodb.driver.core.2.7.0.nupkg.sha512"
|
||||
},
|
||||
@@ -1061,7 +1061,7 @@
|
||||
"runtime.native.System.Net.Security/4.0.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-OpQmF7Ol4t3BVl+x2SURhymksME8f9Ke4uKWAVKPZhGZn6g5bBKvaSllV4nmNKgNQSIhM1x4IOtgc6/32H1OUg==",
|
||||
"sha512": "sha512-pnBEZovOBrJJFp+2ORAs+bYuEQFcO2iYBNbNwRCqzZ9U7Vu66qoTJaekvOGgCyKmslvcevAVLxn7/K9Xc6lwlw==",
|
||||
"path": "runtime.native.system.net.security/4.0.1",
|
||||
"hashPath": "runtime.native.system.net.security.4.0.1.nupkg.sha512"
|
||||
},
|
||||
@@ -1138,14 +1138,14 @@
|
||||
"System.Diagnostics.Process/4.1.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-4dlFhzwmI3hl32P+8c9hnytYtV7Xldhsokm5i7Fvv5PmTS68TQCfsuJrREIyF9N1B8zlsSomp7AVrXLe45kKFQ==",
|
||||
"sha512": "sha512-S2YC+MwpWZ6e7h2lqNce/ubMjD4vf2Ea/uOEncYNH1/fFXaXlKDM9ig/zCE1rR+wwYzE8FXtvj+1Nymh6oZ9bg==",
|
||||
"path": "system.diagnostics.process/4.1.0",
|
||||
"hashPath": "system.diagnostics.process.4.1.0.nupkg.sha512"
|
||||
},
|
||||
"System.Diagnostics.TraceSource/4.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-bGUeY5wiCHYSWbYZS3QjbaQ1hNoJ1RQBQMB3E0Cgh6AH//4rXfXIOHKIW46HDOsTEDoNfvFNDXphL5W5B/XMwQ==",
|
||||
"sha512": "sha512-q5bGzzvXVi+dIMiPWRhXZV7r+Os3TEOuRW5LHsAUDGpqJHol8XiLokVpsgAfPqHHNkyx1bbv5lRZqRkRrGZKxQ==",
|
||||
"path": "system.diagnostics.tracesource/4.0.0",
|
||||
"hashPath": "system.diagnostics.tracesource.4.0.0.nupkg.sha512"
|
||||
},
|
||||
@@ -1250,7 +1250,7 @@
|
||||
"System.Net.Security/4.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-iavC4j5XrRyX3aXbn23jHHF0NTxw9F+2vi3a94VY4BgfrYm5VQBh8OzU1TkNahTSlcKzjGhEc7ZfTfe4b62J6Q==",
|
||||
"sha512": "sha512-e7y/92A7436wJ33VOnUf5XbIlubGgHH7+cODaQkeYwU0xXd/fB/j6KiOdS6VvHcRfBXUYIPsvBOdz3WSNE1siQ==",
|
||||
"path": "system.net.security/4.0.0",
|
||||
"hashPath": "system.net.security.4.0.0.nupkg.sha512"
|
||||
},
|
||||
@@ -1467,7 +1467,7 @@
|
||||
"System.Threading.Overlapped/4.3.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-JpukcZA7kre2gQ7GrhtvZu1xv/LVEG5HV9AajQ3XV7l36T6ICalw/llfkBHeK/eqo8UWpMNqkWGCzzlSuqE6pg==",
|
||||
"sha512": "sha512-JWEtWIoYBHzMmgt2I/1e4FFG6veDL4yzA1Y7iuEY2G+GyZyrzqx/GQlM92M+d81D1cH2dp2KRhbZdQebn8Q+RA==",
|
||||
"path": "system.threading.overlapped/4.3.0",
|
||||
"hashPath": "system.threading.overlapped.4.3.0.nupkg.sha512"
|
||||
},
|
||||
|
||||
Binary file not shown.
@@ -4,7 +4,7 @@ An example of generic repository implementation using the MongoDB C# Sharp 2.0 d
|
||||
Now available as a nuget package:
|
||||
https://www.nuget.org/packages/MongoDbGenericRepository/
|
||||
|
||||
Covered by 200+ integration tests and counting.
|
||||
Covered by 400+ integration tests and counting.
|
||||
|
||||
The MongoDbGenericRepository is also used in [AspNetCore.Identity.MongoDbCore](https://github.com/alexandre-spieser/AspNetCore.Identity.MongoDbCore).
|
||||
|
||||
@@ -40,6 +40,18 @@ Here is an example of repository usage, where the TestRepository is implementing
|
||||
}
|
||||
}
|
||||
```
|
||||
If all your documents have the same type of `Id`, you can use the more specific `BaseMongoRepository<TKey>` where `TKey` is the type of the `Id` of your documents.
|
||||
```csharp
|
||||
public class TestTKeyRepository<TKey> : BaseMongoRepository<TKey>, ITestRepository<TKey> where TKey : IEquatable<TKey>
|
||||
{
|
||||
const string connectionString = "mongodb://localhost:27017/MongoDbTests";
|
||||
private static readonly ITestRepository<TKey> _instance = new TestTKeyRepository<TKey>(connectionString);
|
||||
/// <inheritdoc />
|
||||
private TestTKeyRepository(string connectionString) : base(connectionString)
|
||||
{
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Instantiation
|
||||
|
||||
@@ -47,6 +59,7 @@ The repository can be instantiated like so:
|
||||
|
||||
```csharp
|
||||
ITestRepository testRepository = new TestRepository(connectionString, "MongoDbTests");
|
||||
ITestRepository<TKey> testTKeyRepository = new TestTKeyRepository<TKey>(connectionString);
|
||||
```
|
||||
|
||||
If you prefer to reuse the same MongoDb database across your application, you can use the `MongoDatabase` from the MongoDb driver implementing the `IMongoDatabase` interface:
|
||||
@@ -145,7 +158,7 @@ It is now possible to change the collection name by using the `CollectionName` a
|
||||
Documents of this type will be inserted into a collection named "MyCollectionName".
|
||||
|
||||
## Index Management
|
||||
From version 1.3.8 the `MongoDbGenericRepository` implements the `IMongoDbCollectionIndexRepository` interface.
|
||||
From version 1.3.8 the `MongoDbGenericRepository` implements the `IBaseMongoRepository_Index` and `IBaseMongoRepository_Index<TKey>` interfaces.
|
||||
This exposes the functionality to programmatically manage indexes against your collections in a generic fashion.
|
||||
|
||||
The following methods are exposed and fully integration tested:
|
||||
|
||||
Reference in New Issue
Block a user