mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 13:06:50 +08:00
Update Pgsql entity aop bug
This commit is contained in:
parent
cb87c9b1e0
commit
ab95f57859
@ -96,6 +96,7 @@
|
||||
<Compile Include="Models\Tree.cs" />
|
||||
<Compile Include="Models\ViewOrder.cs" />
|
||||
<Compile Include="Config.cs" />
|
||||
<Compile Include="UnitTest\UAopTest.cs" />
|
||||
<Compile Include="UnitTest\USave.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
29
Src/Asp.Net/PgSqlTest/UnitTest/UAopTest.cs
Normal file
29
Src/Asp.Net/PgSqlTest/UnitTest/UAopTest.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrmTest
|
||||
{
|
||||
public partial class NewUnitTest
|
||||
{
|
||||
|
||||
public static void AopTest()
|
||||
{
|
||||
var db = Db;
|
||||
db.CurrentConnectionConfig.ConfigureExternalServices = new SqlSugar.ConfigureExternalServices()
|
||||
{
|
||||
|
||||
EntityNameService = (t, e) => {
|
||||
|
||||
e.DbTableName = "public." + e.DbTableName;
|
||||
}
|
||||
};
|
||||
db.Queryable<Order>().Select(it=> new {
|
||||
x=SqlSugar.SqlFunc.Subqueryable<Order>().Select(s=>s.Id)
|
||||
}).ToList();
|
||||
db.CurrentConnectionConfig.ConfigureExternalServices = new SqlSugar.ConfigureExternalServices();
|
||||
}
|
||||
}
|
||||
}
|
@ -53,6 +53,14 @@ namespace SqlSugar
|
||||
else if (isMapping)
|
||||
{
|
||||
var mappingInfo = this.MappingTables.FirstOrDefault(it => it.EntityName.Equals(entityName, StringComparison.CurrentCultureIgnoreCase));
|
||||
|
||||
var tableName = mappingInfo.DbTableName+"";
|
||||
if (tableName.Contains("."))
|
||||
{
|
||||
tableName = string.Join(UtilConstants.Dot, tableName.Split(UtilConstants.DotChar).Select(it => GetTranslationText(it)));
|
||||
return tableName;
|
||||
}
|
||||
|
||||
return SqlTranslationLeft + (mappingInfo == null ? entityName : mappingInfo.DbTableName).ToLower(isAutoToLower) + SqlTranslationRight;
|
||||
}
|
||||
else if (isComplex)
|
||||
|
Loading…
Reference in New Issue
Block a user