using MongoDB.Bson; using MongoDB.Bson.Serialization.Attributes; namespace StarterKit.Entities { /// /// These are the base classes for all entities /// The repositories have this class as constraint for entities that are persisted in the database. /// The default will have an integer type key but if desired you can specify a different type id. /// /// public class EntityBaseMongo : IEntityBase { [BsonId] [BsonRepresentation(BsonType.ObjectId)] public T Id { get; set; } } public class EntityBaseMongo : IEntityBase { [BsonId] [BsonRepresentation(BsonType.ObjectId)] public string Id { get; set; } } }