using MongoDB.Bson.Serialization.Attributes; using System; 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. /// public class Document : IDocument { /// /// The document constructor /// public Document() { Id = Guid.NewGuid(); AddedAtUtc = DateTime.UtcNow; } /// /// The Id of the document /// [BsonId] public Guid Id { get; set; } /// /// The datetime in UTC at which the document was added. /// public DateTime AddedAtUtc { get; set; } /// /// The version of the schema of the document /// public int Version { get; set; } } }