-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
202 changed files
with
21,418 additions
and
17,322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,71 @@ | ||
using System; | ||
using System.Reflection; | ||
|
||
namespace XCode | ||
namespace XCode; | ||
|
||
/// <summary>指定实体类属性所绑定数据字段信息。</summary> | ||
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] | ||
public sealed class BindColumnAttribute : Attribute | ||
{ | ||
/// <summary>指定实体类属性所绑定数据字段信息。</summary> | ||
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] | ||
public sealed class BindColumnAttribute : Attribute | ||
{ | ||
#region 属性 | ||
/// <summary>字段名</summary> | ||
public String Name { get; set; } | ||
#region 属性 | ||
/// <summary>字段名</summary> | ||
public String? Name { get; set; } | ||
|
||
/// <summary>描述</summary> | ||
public String Description { get; set; } | ||
/// <summary>描述</summary> | ||
public String? Description { get; set; } | ||
|
||
/// <summary> | ||
/// 原始数据类型。 | ||
/// 当且仅当目标数据库同为该数据库类型时,采用实体属性信息上的RawType作为反向工程的目标字段类型,以期获得开发和生产的最佳兼容。 | ||
/// </summary> | ||
public String RawType { get; set; } | ||
/// <summary> | ||
/// 原始数据类型。 | ||
/// 当且仅当目标数据库同为该数据库类型时,采用实体属性信息上的RawType作为反向工程的目标字段类型,以期获得开发和生产的最佳兼容。 | ||
/// </summary> | ||
public String? RawType { get; set; } | ||
|
||
/// <summary>元素类型</summary> | ||
public String ItemType { get; set; } | ||
/// <summary>元素类型</summary> | ||
public String? ItemType { get; set; } | ||
|
||
/// <summary>精度</summary> | ||
public Int32 Precision { get; set; } | ||
/// <summary>精度</summary> | ||
public Int32 Precision { get; set; } | ||
|
||
/// <summary>位数</summary> | ||
public Int32 Scale { get; set; } | ||
/// <summary>位数</summary> | ||
public Int32 Scale { get; set; } | ||
|
||
/// <summary>默认值</summary> | ||
public String DefaultValue { get; set; } | ||
/// <summary>默认值</summary> | ||
public String? DefaultValue { get; set; } | ||
|
||
/// <summary>是否主字段。主字段作为业务主要字段,代表当前数据行意义</summary> | ||
public Boolean Master { get; set; } | ||
#endregion | ||
///// <summary>元素参数默认值</summary> | ||
//public String? ItemDefaultValue { get; set; } | ||
|
||
#region 构造 | ||
/// <summary>构造函数</summary> | ||
public BindColumnAttribute() { } | ||
/// <summary>是否主字段。主字段作为业务主要字段,代表当前数据行意义</summary> | ||
public Boolean Master { get; set; } | ||
#endregion | ||
|
||
/// <summary>构造函数</summary> | ||
/// <param name="name">字段名</param> | ||
public BindColumnAttribute(String name) | ||
{ | ||
Name = name; | ||
} | ||
#region 构造 | ||
/// <summary>构造函数</summary> | ||
public BindColumnAttribute() { } | ||
|
||
/// <summary>构造函数</summary> | ||
/// <param name="name">名称</param> | ||
/// <param name="description"></param> | ||
/// <param name="rawType"></param> | ||
public BindColumnAttribute(String name, String description, String rawType) | ||
{ | ||
Name = name; | ||
Description = description; | ||
RawType = rawType; | ||
} | ||
#endregion | ||
/// <summary>构造函数</summary> | ||
/// <param name="name">字段名</param> | ||
public BindColumnAttribute(String name) | ||
{ | ||
Name = name; | ||
} | ||
|
||
#region 方法 | ||
/// <summary>检索应用于类型成员的自定义属性。</summary> | ||
/// <param name="element"></param> | ||
/// <returns></returns> | ||
public static BindColumnAttribute GetCustomAttribute(MemberInfo element) | ||
{ | ||
return GetCustomAttribute(element, typeof(BindColumnAttribute)) as BindColumnAttribute; | ||
} | ||
#endregion | ||
/// <summary>构造函数</summary> | ||
/// <param name="name">名称</param> | ||
/// <param name="description"></param> | ||
/// <param name="rawType"></param> | ||
public BindColumnAttribute(String name, String description, String rawType) | ||
{ | ||
Name = name; | ||
Description = description; | ||
RawType = rawType; | ||
} | ||
#endregion | ||
|
||
#region 方法 | ||
/// <summary>检索应用于类型成员的自定义属性。</summary> | ||
/// <param name="element"></param> | ||
/// <returns></returns> | ||
public static BindColumnAttribute? GetCustomAttribute(MemberInfo element) => GetCustomAttribute(element, typeof(BindColumnAttribute)) as BindColumnAttribute; | ||
#endregion | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,65 @@ | ||
using System; | ||
using XCode.DataAccessLayer; | ||
using XCode.DataAccessLayer; | ||
|
||
namespace XCode | ||
namespace XCode; | ||
|
||
/// <summary>指定实体类所绑定的数据表信息。</summary> | ||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] | ||
public sealed class BindTableAttribute : Attribute | ||
{ | ||
/// <summary>指定实体类所绑定的数据表信息。</summary> | ||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] | ||
public sealed class BindTableAttribute : Attribute | ||
{ | ||
/// <summary> | ||
/// 表名。 | ||
/// 可以在配置文件中通过XCode.ConnMaps把实体映射到别的数据表上 | ||
/// </summary> | ||
public String Name { get; set; } | ||
/// <summary> | ||
/// 表名。 | ||
/// 可以在配置文件中通过XCode.ConnMaps把实体映射到别的数据表上 | ||
/// </summary> | ||
public String Name { get; set; } | ||
|
||
/// <summary>描述</summary> | ||
public String Description { get; set; } | ||
/// <summary>描述</summary> | ||
public String? Description { get; set; } | ||
|
||
/// <summary> | ||
/// 连接名。 | ||
/// 实体类的所有数据库操作,将发生在该连接名指定的数据库连接上。 | ||
/// 此外,可动态修改实体类在当前线程上的连接名(改Meta.ConnName); | ||
/// 也可以在配置文件中通过XCode.ConnMaps把连接名映射到别的连接上。 | ||
/// </summary> | ||
public String ConnName { get; set; } | ||
/// <summary> | ||
/// 连接名。 | ||
/// 实体类的所有数据库操作,将发生在该连接名指定的数据库连接上。 | ||
/// 此外,可动态修改实体类在当前线程上的连接名(改Meta.ConnName); | ||
/// 也可以在配置文件中通过XCode.ConnMaps把连接名映射到别的连接上。 | ||
/// </summary> | ||
public String? ConnName { get; set; } | ||
|
||
/// <summary> | ||
/// 数据库类型。 | ||
/// 仅用于记录实体类由何种类型数据库生成,当且仅当目标数据库同为该数据库类型时,采用实体属性信息上的RawType作为反向工程的目标字段类型,以期获得开发和生产的最佳兼容。 | ||
/// </summary> | ||
public DatabaseType DbType { get; set; } | ||
/// <summary> | ||
/// 数据库类型。 | ||
/// 仅用于记录实体类由何种类型数据库生成,当且仅当目标数据库同为该数据库类型时,采用实体属性信息上的RawType作为反向工程的目标字段类型,以期获得开发和生产的最佳兼容。 | ||
/// </summary> | ||
public DatabaseType DbType { get; set; } | ||
|
||
/// <summary>是否视图</summary> | ||
public Boolean IsView { get; set; } | ||
/// <summary>是否视图</summary> | ||
public Boolean IsView { get; set; } | ||
|
||
/// <summary>构造函数</summary> | ||
/// <param name="name">表名</param> | ||
public BindTableAttribute(String name) | ||
{ | ||
Name = name; | ||
} | ||
/// <summary>构造函数</summary> | ||
/// <param name="name">表名</param> | ||
public BindTableAttribute(String name) | ||
{ | ||
Name = name; | ||
} | ||
|
||
/// <summary>构造函数</summary> | ||
/// <param name="name">表名</param> | ||
/// <param name="description">描述</param> | ||
public BindTableAttribute(String name, String description) | ||
{ | ||
Name = name; | ||
Description = description; | ||
} | ||
/// <summary>构造函数</summary> | ||
/// <param name="name">表名</param> | ||
/// <param name="description">描述</param> | ||
public BindTableAttribute(String name, String description) | ||
{ | ||
Name = name; | ||
Description = description; | ||
} | ||
|
||
/// <summary>构造函数</summary> | ||
/// <param name="name">表名</param> | ||
/// <param name="description">描述</param> | ||
/// <param name="connName"></param> | ||
/// <param name="dbType"></param> | ||
/// <param name="isView"></param> | ||
public BindTableAttribute(String name, String description, String connName, DatabaseType dbType, Boolean isView) | ||
{ | ||
Name = name; | ||
Description = description; | ||
ConnName = connName; | ||
DbType = dbType; | ||
IsView = isView; | ||
} | ||
/// <summary>构造函数</summary> | ||
/// <param name="name">表名</param> | ||
/// <param name="description">描述</param> | ||
/// <param name="connName"></param> | ||
/// <param name="dbType"></param> | ||
/// <param name="isView"></param> | ||
public BindTableAttribute(String name, String description, String connName, DatabaseType dbType, Boolean isView) | ||
{ | ||
Name = name; | ||
Description = description; | ||
ConnName = connName; | ||
DbType = dbType; | ||
IsView = isView; | ||
} | ||
} |
Oops, something went wrong.