Adding TKey support
This commit is contained in:
1 parent
5e187e0b1f
commit
9b1048e318
5 files changed
+417
-78
No files matched your search
@@ -6,16 +6,24 @@ namespace MongoDbGenericRepository.Models
|
||||
/// This class represents a basic document that can be stored in MongoDb.
|
||||
/// Your document must implement this class in order for the MongoDbRepository to handle them.
|
||||
/// </summary>
|
||||
public interface IDocument
|
||||
public interface IDocument<TKey> where TKey : IEquatable<TKey>
|
||||
{
|
||||
/// <summary>
|
||||
/// The Guid, which must be decorated with the [BsonId] attribute
|
||||
/// if you want the MongoDb C# driver to consider it to be the document ID.
|
||||
/// </summary>
|
||||
Guid Id { get; set; }
|
||||
TKey Id { get; set; }
|
||||
/// <summary>
|
||||
/// A version number, to indicate the version of the schema.
|
||||
/// </summary>
|
||||
int Version { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class represents a basic document that can be stored in MongoDb.
|
||||
/// Your document must implement this class in order for the MongoDbRepository to handle them.
|
||||
/// </summary>
|
||||
public interface IDocument: IDocument<Guid>
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user