17 lines
362 B
C#
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();
|
|
}
|
|
} |