ExternalAPI_NET8/Model/Entity/MDBBaseEntity.cs
2026-05-21 17:23:36 +08:00

17 lines
362 B
C#

using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace Web.Core.Model.Entity;
public class MDBBaseEntity
{
[BsonRepresentation(BsonType.ObjectId)]
public String Id { get; set; }
/// <summary>
/// 给对象初值
/// </summary>
public MDBBaseEntity()
{
Id = ObjectId.GenerateNewId().ToString();
}
}