using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; using Common.Utils; using MongoDB.Bson.Serialization.Attributes; namespace MongoRepository { public class MongoBaseEntity { [BsonElement("_id")] public string Id { get; set; } = Guid.NewGuid().ToString("N"); [BsonElement("isdelete")] public bool IsDelete { get; set; } = false; [Column(TypeName = "jsonb")] public OptionUserInfo? CreateInfo { get; set; } } [BsonIgnoreExtraElements] public class OptionUserInfo { public OptionUserInfo(string userId, string userName) { UserId = userId; UserName = userName; OptionTime = DateTime.Now.ToTimeStamp(); } public OptionUserInfo() { } public string UserId { get; set; } public string UserName { get; set; } public long OptionTime { get; set; } } }