mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 04:18:16 +08:00
- 增加 ISelect Cancel 用于取消本次查询;
- 增加 IncludeIf/IncludeByPropertyNameIf 方法;
This commit is contained in:
@ -30,6 +30,17 @@ namespace FreeSql
|
||||
Task<long> CountAsync(CancellationToken cancellationToken = default);
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// 控制取消本次查询<para></para>
|
||||
/// * 不会产生额外的异常<para></para>
|
||||
/// * 取消成功,则不执行 SQL 命令<para></para>
|
||||
/// * 取消成功,直接返回没有记录时候的返回值<para></para>
|
||||
/// * 取消成功,如 List<T> 返回 0 元素列表,不是 null,仍然是旧机制<para></para>
|
||||
/// </summary>
|
||||
/// <param name="cancel">返回 true,则不会执行 SQL 命令</param>
|
||||
/// <returns></returns>
|
||||
TSelect Cancel(Func<bool> cancel);
|
||||
|
||||
/// <summary>
|
||||
/// 指定事务对象
|
||||
/// </summary>
|
||||
|
@ -321,6 +321,14 @@ namespace FreeSql
|
||||
/// <returns></returns>
|
||||
ISelect<T1> Include<TNavigate>(Expression<Func<T1, TNavigate>> navigateSelector) where TNavigate : class;
|
||||
/// <summary>
|
||||
/// 贪婪加载导航属性,如果查询中已经使用了 a.Parent.Parent 类似表达式,则可以无需此操作
|
||||
/// </summary>
|
||||
/// <typeparam name="TNavigate"></typeparam>
|
||||
/// <param name="condition">true 时生效</param>
|
||||
/// <param name="navigateSelector">选择一个导航属性</param>
|
||||
/// <returns></returns>
|
||||
ISelect<T1> IncludeIf<TNavigate>(bool condition, Expression<Func<T1, TNavigate>> navigateSelector) where TNavigate : class;
|
||||
/// <summary>
|
||||
/// 贪婪加载集合的导航属性,其实是分两次查询,ToList 后进行了数据重装<para></para>
|
||||
/// 文档:https://github.com/2881099/FreeSql/wiki/%e8%b4%aa%e5%a9%aa%e5%8a%a0%e8%bd%bd#%E5%AF%BC%E8%88%AA%E5%B1%9E%E6%80%A7-onetomanymanytomany
|
||||
/// </summary>
|
||||
@ -340,6 +348,13 @@ namespace FreeSql
|
||||
/// <param name="property"></param>
|
||||
/// <returns></returns>
|
||||
ISelect<T1> IncludeByPropertyName(string property);
|
||||
/// <summary>
|
||||
/// 按属性名字符串进行 Include/IncludeMany 操作
|
||||
/// </summary>
|
||||
/// <param name="condition">true 时生效</param>
|
||||
/// <param name="property"></param>
|
||||
/// <returns></returns>
|
||||
ISelect<T1> IncludeByPropertyNameIf(bool condition, string property);
|
||||
|
||||
/// <summary>
|
||||
/// 实现 select .. from ( select ... from t ) a 这样的功能<para></para>
|
||||
|
Reference in New Issue
Block a user