diff --git a/FreeSql.DbContext/FreeSql.DbContext.xml b/FreeSql.DbContext/FreeSql.DbContext.xml index 27909b2e..02eb0609 100644 --- a/FreeSql.DbContext/FreeSql.DbContext.xml +++ b/FreeSql.DbContext/FreeSql.DbContext.xml @@ -512,14 +512,5 @@ - - - 批量注入 Repository,可以参考代码自行调整 - - - - - - diff --git a/FreeSql.Tests/FreeSql.Tests/Issues/592.cs b/FreeSql.Tests/FreeSql.Tests/Issues/592.cs new file mode 100644 index 00000000..97da64b5 --- /dev/null +++ b/FreeSql.Tests/FreeSql.Tests/Issues/592.cs @@ -0,0 +1,64 @@ +using FreeSql.DataAnnotations; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Diagnostics; +using System.Reflection; +using System.Text; +using System.Threading; +using Xunit; + +namespace FreeSql.Tests.Issues +{ + public class _592 + { + [Fact] + public void AdoNet() + { + using (var conn = g.mysql.Ado.MasterPool.Get()) + { + var list = conn.Value.Select() + .LeftJoin((rs, le) => rs.user_id == le.ur_userid) + .Where((rs, le) => rs.user_id > 0) + .Count(); + } + } + + [Table(Name = "park_sys_users")] + public partial class park_sys_users + { + public park_sys_users() + { + } + + [Column(IsIdentity = true)] + public int user_id { get; set; } + public string user_loginname { get; set; } + public string user_name { get; set; } + public string user_pwd { get; set; } + public int user_type { get; set; } + public string user_spotid { get; set; } + public string user_phone { get; set; } + public string user_email { get; set; } + public string user_remark { get; set; } + public int user_specialrole { get; set; } + public string user_createuser { get; set; } + public DateTime user_createtime { get; set; } + public int user_state { get; set; } + public int user_managetype { get; set; } + } + + public partial class park_sys_userrole + { + public park_sys_userrole() + { + } + + public int ur_id { get; set; } + public int ur_userid { get; set; } + public int ur_roleid { get; set; } + } + } +} diff --git a/FreeSql/Extensions/AdoNetExtensions.cs b/FreeSql/Extensions/AdoNetExtensions.cs index 09ed187a..f1dc6bf9 100644 --- a/FreeSql/Extensions/AdoNetExtensions.cs +++ b/FreeSql/Extensions/AdoNetExtensions.cs @@ -195,63 +195,63 @@ namespace FreeSql /// /// public static ISelect Select(this IDbConnection that) where T1 : class where T2 : class => - GetCrud(that).Select().From((s, b) => s); + Select(that).From((s, b) => s); /// /// 多表查询 /// /// /// public static ISelect Select(this IDbConnection that) where T1 : class where T2 : class where T3 : class => - GetCrud(that).Select().From((s, b, c) => s); + Select(that).From((s, b, c) => s); /// /// 多表查询 /// /// /// public static ISelect Select(this IDbConnection that) where T1 : class where T2 : class where T3 : class where T4 : class => - GetCrud(that).Select().From((s, b, c, d) => s); + Select(that).From((s, b, c, d) => s); /// /// 多表查询 /// /// /// public static ISelect Select(this IDbConnection that) where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class => - GetCrud(that).Select().From((s, b, c, d, e) => s); + Select(that).From((s, b, c, d, e) => s); /// /// 多表查询 /// /// /// public static ISelect Select(this IDbConnection that) where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class => - GetCrud(that).Select().From((s, b, c, d, e, f) => s); + Select(that).From((s, b, c, d, e, f) => s); /// /// 多表查询 /// /// /// public static ISelect Select(this IDbConnection that) where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class => - GetCrud(that).Select().From((s, b, c, d, e, f, g) => s); + Select(that).From((s, b, c, d, e, f, g) => s); /// /// 多表查询 /// /// /// public static ISelect Select(this IDbConnection that) where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class => - GetCrud(that).Select().From((s, b, c, d, e, f, g, h) => s); + Select(that).From((s, b, c, d, e, f, g, h) => s); /// /// 多表查询 /// /// /// public static ISelect Select(this IDbConnection that) 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 => - GetCrud(that).Select().From((s, b, c, d, e, f, g, h, i) => s); + Select(that).From((s, b, c, d, e, f, g, h, i) => s); /// /// 多表查询 /// /// /// public static ISelect Select(this IDbConnection that) 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 => - GetCrud(that).Select().From((s, b, c, d, e, f, g, h, i, j) => s); + Select(that).From((s, b, c, d, e, f, g, h, i, j) => s); #endregion #region IDbTransaction @@ -365,55 +365,55 @@ namespace FreeSql /// /// public static ISelect Select(this IDbTransaction that) where T1 : class where T2 : class => - GetCrud(that).Select().From((s, b) => s); + Select(that).From((s, b) => s); /// /// 多表查询 /// /// public static ISelect Select(this IDbTransaction that) where T1 : class where T2 : class where T3 : class => - GetCrud(that).Select().From((s, b, c) => s); + Select(that).From((s, b, c) => s); /// /// 多表查询 /// /// public static ISelect Select(this IDbTransaction that) where T1 : class where T2 : class where T3 : class where T4 : class => - GetCrud(that).Select().From((s, b, c, d) => s); + Select(that).From((s, b, c, d) => s); /// /// 多表查询 /// /// public static ISelect Select(this IDbTransaction that) where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class => - GetCrud(that).Select().From((s, b, c, d, e) => s); + Select(that).From((s, b, c, d, e) => s); /// /// 多表查询 /// /// public static ISelect Select(this IDbTransaction that) where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class => - GetCrud(that).Select().From((s, b, c, d, e, f) => s); + Select(that).From((s, b, c, d, e, f) => s); /// /// 多表查询 /// /// public static ISelect Select(this IDbTransaction that) where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class => - GetCrud(that).Select().From((s, b, c, d, e, f, g) => s); + Select(that).From((s, b, c, d, e, f, g) => s); /// /// 多表查询 /// /// public static ISelect Select(this IDbTransaction that) where T1 : class where T2 : class where T3 : class where T4 : class where T5 : class where T6 : class where T7 : class where T8 : class => - GetCrud(that).Select().From((s, b, c, d, e, f, g, h) => s); + Select(that).From((s, b, c, d, e, f, g, h) => s); /// /// 多表查询 /// /// public static ISelect Select(this IDbTransaction that) 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 => - GetCrud(that).Select().From((s, b, c, d, e, f, g, h, i) => s); + Select(that).From((s, b, c, d, e, f, g, h, i) => s); /// /// 多表查询 /// /// public static ISelect Select(this IDbTransaction that) 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 => - GetCrud(that).Select().From((s, b, c, d, e, f, g, h, i, j) => s); + Select(that).From((s, b, c, d, e, f, g, h, i, j) => s); #endregion #endregion