diff --git a/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Main.cs b/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Main.cs
index a984e58f8..57b8960a3 100644
--- a/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Main.cs
+++ b/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/Main.cs
@@ -33,6 +33,7 @@ namespace OrmTest
}
public static void Init()
{
+ UnitDynamicCoread12321.Init();
UnitManyToManyadfafa.Init();
UnitAsyncToken.Init();
UnitManyToMany121231.Init();
diff --git a/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/UnitDynamicCoread12321.cs b/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/UnitDynamicCoread12321.cs
new file mode 100644
index 000000000..9a7523378
--- /dev/null
+++ b/Src/Asp.NetCore2/SqlSeverTest/UserTestCases/UnitTest/UnitDynamicCoread12321.cs
@@ -0,0 +1,101 @@
+using SqlSugar;
+using System;
+using System.Linq.Dynamic.Core;
+using System.Threading.Tasks;
+
+namespace OrmTest
+{
+ public class UnitDynamicCoread12321
+ {
+ ///
+ /// 管理系统角色
+ ///
+ [SugarTable("a", IsDisabledUpdateAll = true)]
+ public class AT
+ {
+
+ ///
+ /// 角色名称
+ ///
+ [SugarColumn(ColumnName = "id")]
+ public long Id { get; set; }
+
+ ///
+ /// 角色名称
+ ///
+ [SugarColumn(ColumnName = "name", Length = 100)]
+ public string Name { get; set; } = string.Empty;
+
+ ///
+ /// 角色描述
+ ///
+ [SugarColumn(ColumnName = "desc", Length = 100)]
+ public string Desc { get; set; } = string.Empty;
+
+ public string BName { get; set; }
+
+ }
+
+ ///
+ /// 管理系统角色
+ ///
+ [SugarTable("b", IsDisabledUpdateAll = true)]
+ public class BT
+ {
+
+ ///
+ /// 角色名称
+ ///
+ [SugarColumn(ColumnName = "id")]
+ public long Id { get; set; }
+
+
+ ///
+ /// 角色名称
+ ///
+ [SugarColumn(ColumnName = "aid")]
+ public long Aid { get; set; }
+
+ ///
+ /// 角色名称
+ ///
+ [SugarColumn(ColumnName = "name", Length = 100)]
+ public string Name { get; set; } = string.Empty;
+
+ ///
+ /// 角色描述
+ ///
+ [SugarColumn(ColumnName = "desc", Length = 100)]
+ public string Desc { get; set; } = string.Empty;
+
+ }
+
+
+ public static void Init()
+ {
+
+ StaticConfig.DynamicExpressionParserType = typeof(DynamicExpressionParser);
+ var db = NewUnitTest.Db;
+
+ var shortNames = DynamicParameters.Create("x", typeof(AT), "u", typeof(BT));
+ var sql = db.QueryableByObject(typeof(AT), "x")
+ .AddJoinInfo(typeof(BT),
+ shortNames,
+ $"x.Id==u.Aid",
+ JoinType.Left)
+ .Select(shortNames, $"new (x.Name as Name,u.Name as BName)", typeof(AT))
+ .ToSql().Key;
+ if (sql.Contains( "Aid"))
+ {
+ throw new Exception("unit error");
+ }
+
+ Console.WriteLine(sql);
+
+ /// SELECT `x`.`name` AS `Name` , `u`.`name` AS `BName` FROM `a` x Left JOIN `b` `u` ON ( `x`.`id` = `u`.`Aid` )
+
+
+ }
+ }
+
+}