wzp
2021-07-19 e65183d31755a0e5fae4bf428435d2e0fd6afdc5
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace DapperExtensions
{
    /// <summary>
    /// 表属性 Table("people")
    /// </summary>
    [AttributeUsage(AttributeTargets.Class)]
    public class TableAttribute : Attribute
    {
        public string Name { get; set; }
        public TableAttribute(string tableName)
        {
            this.Name = tableName;
        }
    }
 
    /// <summary>
    /// 主键属性 Key(true)  Key(false) 表示主键自增、或者主键非自增
    /// </summary>
    [AttributeUsage(AttributeTargets.Property)]
    public class KeyAttribute : Attribute
    {
        public bool IsIdentity { get; set; }
        public KeyAttribute(bool isidentity)
        {
            IsIdentity = isidentity;
        }
    }
 
    /// <summary>
    /// 忽略列,表示非数据库字段
    /// </summary>
    [AttributeUsage(AttributeTargets.Property)]
    public class ComputedAttribute : Attribute
    {
 
    }
}