forked from zhontai/Admin.Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntityBase.cs
More file actions
74 lines (64 loc) · 2.12 KB
/
EntityBase.cs
File metadata and controls
74 lines (64 loc) · 2.12 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using FreeSql.DataAnnotations;
namespace Admin.Core.Common.BaseModel
{
/// <summary>
/// 实体审计
/// </summary>
public class EntityBase<TKey> : Entity<TKey>, IEntityVersion, IEntitySoftDelete, IEntityAdd<TKey>, IEntityUpdate<TKey> where TKey : struct
{
/// <summary>
/// 版本
/// </summary>
[Description("版本")]
[Column(Position = -9, IsVersion = true)]
public long Version { get; set; }
/// <summary>
/// 是否删除
/// </summary>
[Description("是否删除")]
[Column(Position = -8)]
public bool IsDeleted { get; set; } = false;
/// <summary>
/// 创建者Id
/// </summary>
[Description("创建者Id")]
[Column(Position = -7, CanUpdate = false)]
public TKey? CreatedUserId { get; set; }
/// <summary>
/// 创建者
/// </summary>
[Description("创建者")]
[Column(Position = -6, CanUpdate = false), MaxLength(50)]
public string CreatedUserName { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[Description("创建时间")]
[Column(Position = -5, CanUpdate = false, ServerTime = DateTimeKind.Local)]
public DateTime? CreatedTime { get; set; }
/// <summary>
/// 修改者Id
/// </summary>
[Description("修改者Id")]
[Column(Position = -4, CanInsert = false)]
public TKey? ModifiedUserId { get; set; }
/// <summary>
/// 修改者
/// </summary>
[Description("修改者")]
[Column(Position = -2, CanInsert = false), MaxLength(50)]
public string ModifiedUserName { get; set; }
/// <summary>
/// 修改时间
/// </summary>
[Description("修改时间")]
[Column(Position = -1, CanInsert = false, ServerTime = DateTimeKind.Local)]
public DateTime? ModifiedTime { get; set; }
}
public class EntityBase : EntityBase<long>
{
}
}