mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 20:38:16 +08:00
- 增加 Column.MapType 类型映射,可将 enum 映射为 int/string 等;
This commit is contained in:
@ -46,6 +46,6 @@ namespace FreeSql.DataAnnotations {
|
||||
/// <summary>
|
||||
/// 类型映射,比如:可将 enum 属性映射成 typeof(string)
|
||||
/// </summary>
|
||||
public Type Mapping { get; set; }
|
||||
public Type MapType { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user