source/Repid.Entity/EntityBase.cs

(完整代码) 929B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Repid.Entity
{
    /// <summary>
    /// 实体基类
    /// </summary>
    public abstract class EntityBase
    {
        /// <summary>
        /// 主键字段
        /// </summary>
        public string ID { get; set; }

        /// <summary>
        /// 插入时间
        /// </summary>
        public DateTime InsertTime { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdateTime { get; set; }

        /// <summary>
        /// 初始化编号
        /// </summary>
        public void InitializationID(bool isNewID = false)
        {
            if (string.IsNullOrEmpty(ID) || isNewID)
            {
                // 设置简短版 Guid 编号
                ID = Guid.NewGuid().ToString().Replace("-", string.Empty);
            }
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。