DynamicFilterCustom 增加支持 Expression 返回值

This commit is contained in:
hd2y
2022-05-30 00:39:23 +08:00
parent 184d11d692
commit 4fe40d0be0
5 changed files with 410 additions and 21 deletions

View File

@ -4336,6 +4336,7 @@
将对象池设置为不可用,后续 Get/GetAsync 均会报错,同时启动后台定时检查服务恢复可用
</summary>
<param name="exception"></param>
<param name="lastGetTime"></param>
<returns>由【可用】变成【不可用】时返回true否则返回false</returns>
</member>
<member name="P:FreeSql.Internal.ObjectPool.IObjectPool`1.Statistics">

View File

@ -811,8 +811,8 @@ namespace FreeSql.Internal.CommonProvider
var fiValue0MethodReturn = fiValue0Method?.Invoke(null, fiValue0Method.GetParameters()
.Select(a => a.ParameterType == typeof(object) ? (object)this :
(a.ParameterType == typeof(string) ? (object)(fi.Value?.ToString()) : (object)null))
.ToArray())?.ToString();
exp = Expression.Call(typeof(SqlExt).GetMethod("InternalRawSql", BindingFlags.NonPublic | BindingFlags.Static), Expression.Constant(fiValue0MethodReturn, typeof(string)));
.ToArray());
exp = fiValue0MethodReturn is Expression expression ? expression : Expression.Call(typeof(SqlExt).GetMethod("InternalRawSql", BindingFlags.NonPublic | BindingFlags.Static), Expression.Constant(fiValue0MethodReturn?.ToString(), typeof(string)));
break;
case DynamicFilterOperator.Contains: