Adding TKey support

This commit is contained in:
alexandre-spieser
2017-09-23 22:00:31 +00:00
parent 5e187e0b1f
commit 9b1048e318
5 changed files with 417 additions and 78 deletions
@@ -1,5 +1,6 @@
using MongoDB.Driver;
using MongoDbGenericRepository.Models;
using System;
namespace MongoDbGenericRepository
{
@@ -31,6 +32,16 @@ namespace MongoDbGenericRepository
/// <param name="partitionKey">The value of the partition key.</param>
IMongoCollection<TDocument> GetCollection<TDocument>(string partitionKey) where TDocument : IDocument;
/// <summary>
/// Returns a collection for a document type that has a partition key.
/// </summary>
/// <typeparam name="TDocument">The type representing a Document.</typeparam>
/// <typeparam name="TKey">The type of the primary key for a Document.</typeparam>
/// <param name="partitionKey">The value of the partition key.</param>
IMongoCollection<TDocument> GetCollection<TDocument, TKey>(string partitionKey)
where TDocument : IDocument<TKey>
where TKey : IEquatable<TKey>;
/// <summary>
/// Drops a collection, use very carefully.
/// </summary>