Files
mongodb-generic-repository/MongoDbGenericRepository/Models/IDocument.cs
T
2017-09-09 19:13:32 +00:00

25 lines
874 B
C#

using System;
namespace MongoDbGenericRepository.Models
{
/// <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
{
/// <summary>
/// The date and UTC time at which the document was added to the collection.
/// </summary>
DateTime AddedAtUtc { get; set; }
/// <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; }
/// <summary>
/// A version number, to indicate the version of the schema.
/// </summary>
int Version { get; set; }
}
}