Adding TKey support
This commit is contained in:
@@ -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