BaseEntityCU.cs 1006 Bytes
using System;
using System.ComponentModel.DataAnnotations;
using ColumnAttribute = System.ComponentModel.DataAnnotations.Schema.ColumnAttribute;

namespace HHECS.Model.Entities
{
    /// <summary>
    /// 扩展基类,包含created等,created自动写入
    /// </summary>
    public abstract class BaseEntityCU<T> : BaseEntity<T>
    {

        private DateTime? dateTime;

        /// <summary>
        /// 创建时间
        /// </summary>
        [Column(Order = 40)]
        public DateTime? Created
        {
            get { return dateTime; }
            set { dateTime = value; }
        }

        [Column(Order = 41)]
        [MaxLength(20)]
        public string CreatedBy { get; set; }

        /// <summary>
        /// 对于更新时间,不自动写入,允许为null
        /// </summary>
        [Column(Order = 42)]
        public DateTime? Updated { get; set; }

        [Column(Order = 43)]
        [MaxLength(20)]
        public string UpdatedBy { get; set; }

    }
}