BaseEntityCU.cs
1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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; }
}
}