From 754bdb8e86249fd3208903ede4edb8138e0867da Mon Sep 17 00:00:00 2001 From: "610262374@qq.com" <610262374@qq.com> Date: Fri, 3 Mar 2017 10:44:00 +0800 Subject: [PATCH] - --- SqlSugar/Entities/SugarList.cs | 5 +++++ SqlSugar/SqlSugarAccessory.cs | 2 +- SqlSugar/SqlSugarClient.cs | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/SqlSugar/Entities/SugarList.cs b/SqlSugar/Entities/SugarList.cs index 77c077c69..9140507b8 100644 --- a/SqlSugar/Entities/SugarList.cs +++ b/SqlSugar/Entities/SugarList.cs @@ -12,6 +12,11 @@ namespace SqlSugar this.RemoveAll(it => it.EntityName.Equals(entityName, StringComparison.CurrentCultureIgnoreCase)); this.Add(new MappingTable() { EntityName = entityName, DbTableName = dbTableName }); } + public void Add(string entityName, string dbTableName,string dbTableShortName) + { + this.RemoveAll(it => it.EntityName.Equals(entityName, StringComparison.CurrentCultureIgnoreCase)); + this.Add(new MappingTable() { EntityName = entityName, DbTableName = dbTableName, DbShortTaleName =dbTableShortName}); + } } public class MappingColumnList: List diff --git a/SqlSugar/SqlSugarAccessory.cs b/SqlSugar/SqlSugarAccessory.cs index 5a1e694cc..601307923 100644 --- a/SqlSugar/SqlSugarAccessory.cs +++ b/SqlSugar/SqlSugarAccessory.cs @@ -101,7 +101,7 @@ namespace SqlSugar }); } - protected List GetJoinInfos(Expression joinExpression, SqlSugarClient context) + protected List GetJoinInfos(Expression joinExpression, SqlSugarClient context,params Type [] entityTypeArray) { ExpressionContext exp = new ExpressionContext(); exp.Resolve(joinExpression, ResolveExpressType.Join); diff --git a/SqlSugar/SqlSugarClient.cs b/SqlSugar/SqlSugarClient.cs index 965b26fbd..b221b738b 100644 --- a/SqlSugar/SqlSugarClient.cs +++ b/SqlSugar/SqlSugarClient.cs @@ -144,7 +144,7 @@ namespace SqlSugar public virtual ISugarQueryable Queryable(Expression> joinExpression) where T : class, new() { var queryable = Queryable(); - SqlBuilder.LambadaQueryBuilder.JoinQueryInfos = base.GetJoinInfos(joinExpression,this); + SqlBuilder.LambadaQueryBuilder.JoinQueryInfos = base.GetJoinInfos(joinExpression,this,typeof(T), typeof(T2)); return queryable; } public virtual ISugarQueryable Queryable(Func joinExpression) where T : class, new()