FreeSql/FreeSql/DataAnnotations/ExpressionCallAttribute.cs
28810 e9a8ad70a1 - 增加 ICodeFirst.IsGenerateCommandParameterWithLambda 选项,开启表达式解析的命令参数化;
- 增加 ExpressionCallContext 自定义函数上下文档 DbParameter 属性;
- 修复 IncludeMany(a => a.x1.x2.Childs) 当 x1, x2 为 null 的报 null 错误;
2019-11-22 21:55:36 +08:00

35 lines
954 B
C#

using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Text;
namespace FreeSql.DataAnnotations
{
/// <summary>
/// 自定义表达式函数解析<para></para>
/// 注意:请使用静态扩展类
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
public class ExpressionCallAttribute : Attribute
{
}
public class ExpressionCallContext
{
/// <summary>
/// 数据库类型,可用于适配多种数据库环境
/// </summary>
public DataType DataType { get; internal set; }
/// <summary>
/// 已解析的表达式中参数内容
/// </summary>
public Dictionary<string, string> Values { get; } = new Dictionary<string, string>();
/// <summary>
/// 主对象的参数化对象,可重塑其属性
/// </summary>
public DbParameter DbParameter { get; internal set; }
}
}