diff --git a/FreeSql.Tests/FreeSql.Tests/UnitTest1.cs b/FreeSql.Tests/FreeSql.Tests/UnitTest1.cs index 2d38490e..351dda5e 100644 --- a/FreeSql.Tests/FreeSql.Tests/UnitTest1.cs +++ b/FreeSql.Tests/FreeSql.Tests/UnitTest1.cs @@ -342,7 +342,7 @@ namespace FreeSql.Tests public void Test1() { var kfkfjdfg = g.oracle.Select().Where(a => (DateTime.Now - a.EditTime).TotalMinutes > 100).ToSql(); - + g.oracle.Aop.SyncStructureAfter += (s, e) => Trace.WriteLine(e.Sql); diff --git a/FreeSql/Extensions/FreeSqlGlobalExtensions.cs b/FreeSql/Extensions/FreeSqlGlobalExtensions.cs index 68855572..02fba7c2 100644 --- a/FreeSql/Extensions/FreeSqlGlobalExtensions.cs +++ b/FreeSql/Extensions/FreeSqlGlobalExtensions.cs @@ -10,9 +10,6 @@ using System.Reflection; public static partial class FreeSqlGlobalExtensions { - - public static FreeSql.ISelect Queryable(this IFreeSql freesql) where T : class => freesql.Select(); - static Lazy> dicIsNumberType = new Lazy>(() => new Dictionary { [typeof(sbyte)] = true, @@ -109,4 +106,63 @@ public static partial class FreeSqlGlobalExtensions { return orm?.Select(); } + + public static FreeSql.ISelect Queryable(this IFreeSql freesql) where T : class => freesql.Select(); + + #region 多表查询 + /// + /// 多表查询 + /// + /// + public static ISelect Select(this IFreeSql freesql) where T1 : class where T2 : class => + freesql.Select().From((s, b) => s); + /// + /// 多表查询 + /// + /// + public static ISelect Select(this IFreeSql freesql) where T1 : class where T2 : class where T3 : class => + freesql.Select().From((s, b, c) => s); + /// + /// 多表查询 + /// + /// + public static ISelect Select(this IFreeSql freesql) where T1 : class where T2 : class where T3 : class where T4 : class => + freesql.Select().From((s, b, c, d) => s); + /// + /// 多表查询 + /// + /// + public static ISelect Select(this IFreeSql freesql) where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class => + freesql.Select().From((s, b, c, d, e) => s); + /// + /// 多表查询 + /// + /// + public static ISelect Select(this IFreeSql freesql) where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class => + freesql.Select().From((s, b, c, d, e, f) => s); + /// + /// 多表查询 + /// + /// + public static ISelect Select(this IFreeSql freesql) where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class => + freesql.Select().From((s, b, c, d, e, f, g) => s); + /// + /// 多表查询 + /// + /// + public static ISelect Select(this IFreeSql freesql) where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class => + freesql.Select().From((s, b, c, d, e, f, g, h) => s); + /// + /// 多表查询 + /// + /// + public static ISelect Select(this IFreeSql freesql) where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class => + freesql.Select().From((s, b, c, d, e, f, g, h, i) => s); + /// + /// 多表查询 + /// + /// + public static ISelect Select(this IFreeSql freesql) where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class where T9 : class where T10 : class => + freesql.Select().From((s, b, c, d, e, f, g, h, i, j) => s); + #endregion } \ No newline at end of file diff --git a/FreeSql/FreeSql.xml b/FreeSql/FreeSql.xml index 5c6d9d2b..6818bf46 100644 --- a/FreeSql/FreeSql.xml +++ b/FreeSql/FreeSql.xml @@ -2388,6 +2388,60 @@ + + + 多表查询 + + + + + + 多表查询 + + + + + + 多表查询 + + + + + + 多表查询 + + + + + + 多表查询 + + + + + + 多表查询 + + + + + + 多表查询 + + + + + + 多表查询 + + + + + + 多表查询 + + + 使用 and 拼接两个 lambda 表达式