using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;

namespace BukiVedi.Shared.Entities
{
    public abstract class BaseEntity
        : IEntity
    {
        [BsonId]
        [BsonRepresentation(BsonType.ObjectId)]
        public string Id { get; set; }

        public BaseEntity()
        {
            Id = ObjectId.GenerateNewId().ToString();
        }

        public BaseEntity(string id)
        {
            Id = id;
        }
    }
}
