mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 04:18:16 +08:00
pgsql/mysql/sqlserver适配
This commit is contained in:
32
FreeSql/DataAnnotations/ColumnAttribute.cs
Normal file
32
FreeSql/DataAnnotations/ColumnAttribute.cs
Normal file
@ -0,0 +1,32 @@
|
||||
using System;
|
||||
|
||||
namespace FreeSql.DataAnnotations {
|
||||
public class ColumnAttribute : Attribute {
|
||||
|
||||
/// <summary>
|
||||
/// 数据库列名
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
/// <summary>
|
||||
/// 指定数据库旧的列名,修改实体属性命名时,同时设置此参数为修改之前的值,CodeFirst才可以正确修改数据库字段;否则将视为【新增字段】
|
||||
/// </summary>
|
||||
public string OldName { get; set; }
|
||||
/// <summary>
|
||||
/// 数据库类型,如: varchar(255)
|
||||
/// </summary>
|
||||
public string DbType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public bool IsPrimary { get; set; }
|
||||
/// <summary>
|
||||
/// 自增标识
|
||||
/// </summary>
|
||||
public bool IsIdentity { get; set; }
|
||||
/// <summary>
|
||||
/// 是否可DBNull
|
||||
/// </summary>
|
||||
public bool IsNullable { get; set; }
|
||||
}
|
||||
}
|
19
FreeSql/DataAnnotations/TableAttribute.cs
Normal file
19
FreeSql/DataAnnotations/TableAttribute.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
namespace FreeSql.DataAnnotations {
|
||||
public class TableAttribute : Attribute {
|
||||
|
||||
/// <summary>
|
||||
/// 数据库表名
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
/// <summary>
|
||||
/// 指定数据库旧的表名,修改实体命名时,同时设置此参数为修改之前的值,CodeFirst才可以正确修改数据库表;否则将视为【创建新表】
|
||||
/// </summary>
|
||||
public string OldName { get; set; }
|
||||
/// <summary>
|
||||
/// 查询过滤SQL,实现类似 a.IsDeleted = 1 功能
|
||||
/// </summary>
|
||||
public string SelectFilter { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user