DapperExtensions/DapperExtAttributes.cs
(完整代码) 1001Busing 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
{
}
}
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
