mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 18:52:50 +08:00
- 增加 TypeHandler override FluentApi 设置;
This commit is contained in:
parent
3335a84158
commit
402ff40135
@ -613,6 +613,7 @@ namespace FreeSql
|
||||
{
|
||||
if (e.Property.PropertyType == typeHandler.Type)
|
||||
{
|
||||
typeHandler.FluentApi(new ColumnFluent(e.ModifyResult, e.Property, e.EntityType));
|
||||
if (_dicTypeHandlerTypes.ContainsKey(e.Property.PropertyType)) return;
|
||||
if (e.Property.PropertyType.NullableTypeOrThis() != typeof(DateTime) &&
|
||||
FreeSql.Internal.Utils.dicExecuteArrayRowReadClassOrTuple.ContainsKey(e.Property.PropertyType))
|
||||
|
@ -1,4 +1,5 @@
|
||||
using FreeSql.Internal.Model.Interface;
|
||||
using FreeSql.DataAnnotations;
|
||||
using FreeSql.Internal.Model.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
@ -12,12 +13,14 @@ namespace FreeSql.Internal.Model
|
||||
Type Type { get; }
|
||||
object Deserialize(object value);
|
||||
object Serialize(object value);
|
||||
void FluentApi(ColumnFluent col);
|
||||
}
|
||||
}
|
||||
public abstract class TypeHandler<T> : ITypeHandler
|
||||
{
|
||||
public abstract T Deserialize(object value);
|
||||
public abstract object Serialize(T value);
|
||||
public virtual void FluentApi(ColumnFluent col) { }
|
||||
|
||||
public Type Type => typeof(T);
|
||||
object ITypeHandler.Deserialize(object value) => this.Deserialize(value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user