- 增加 Column.MapType 类型映射,可将 enum 映射为 int/string 等;

This commit is contained in:
28810
2019-04-26 06:30:30 +08:00
parent 205421f7e0
commit 24df5d6107
47 changed files with 4131 additions and 827 deletions

View File

@ -46,6 +46,6 @@ namespace FreeSql.DataAnnotations {
/// <summary>
/// 类型映射,比如:可将 enum 属性映射成 typeof(string)
/// </summary>
public Type Mapping { get; set; }
public Type MapType { get; set; }
}
}

View File

@ -1,4 +1,6 @@
namespace FreeSql.DataAnnotations {
using System;
namespace FreeSql.DataAnnotations {
public class ColumnFluent {
public ColumnFluent(ColumnAttribute column) {
@ -62,5 +64,14 @@
_column.IsVersion = value;
return this;
}
/// <summary>
/// 类型映射,比如:可将 enum 属性映射成 typeof(string)
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
public ColumnFluent MapType(Type type) {
_column.MapType = type;
return this;
}
}
}