Adding TKey support
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user