From 2bfb9c262103ccf76a59f1d862a33b31c104becc Mon Sep 17 00:00:00 2001
From: 2881099 <2881099@qq.com>
Date: Sun, 3 Dec 2023 19:52:00 +0800
Subject: [PATCH] =?UTF-8?q?v3.2.806-preview20231204=20-=20=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=20WithSql().WhereDynamicFilter=20=E7=9A=84=E6=94=AF?=
=?UTF-8?q?=E6=8C=81=EF=BC=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Directory.Build.props | 2 +-
.../FreeSql.Extensions.AggregateRoot.csproj | 2 +-
.../FreeSql.Extensions.BaseEntity.csproj | 2 +-
.../FreeSql.Extensions.JsonMap.csproj | 2 +-
.../FreeSql.Extensions.LazyLoading.csproj | 2 +-
.../FreeSql.Extensions.Linq.csproj | 2 +-
.../FreeSql.Generator.csproj | 2 +-
FreeSql.All/FreeSql.All.csproj | 2 +-
FreeSql.DbContext/FreeSql.DbContext.csproj | 2 +-
FreeSql.DbContext/FreeSql.DbContext.xml | 18 -------------
FreeSql.Repository/FreeSql.Repository.csproj | 2 +-
.../FreeSqlGlobalExpressionCallExtensions.cs | 17 +++++++-----
FreeSql/FreeSql.csproj | 2 +-
.../SelectProvider/Select0Provider.cs | 27 ++++++++++++++++---
FreeSql/Internal/UtilsExpressionTree.cs | 7 +++++
.../FreeSql.Provider.ClickHouse.csproj | 2 +-
.../FreeSql.Provider.Custom.csproj | 2 +-
.../FreeSql.Provider.Dameng.csproj | 2 +-
.../FreeSql.Provider.Firebird.csproj | 2 +-
.../FreeSql.Provider.GBase.csproj | 2 +-
.../FreeSql.Provider.KingbaseES.csproj | 2 +-
.../FreeSql.Provider.MsAccess.csproj | 2 +-
.../FreeSql.Provider.MySql.csproj | 2 +-
.../FreeSql.Provider.MySqlConnector.csproj | 2 +-
.../FreeSql.Provider.Odbc.csproj | 2 +-
.../FreeSql.Provider.Oracle.csproj | 2 +-
.../FreeSql.Provider.OracleOledb.csproj | 2 +-
.../FreeSql.Provider.PostgreSQL.csproj | 2 +-
.../FreeSql.Provider.QuestDb.csproj | 2 +-
.../FreeSql.Provider.ShenTong.csproj | 2 +-
.../FreeSql.Provider.SqlServer.csproj | 2 +-
...FreeSql.Provider.SqlServerForSystem.csproj | 2 +-
.../FreeSql.Provider.Sqlite.csproj | 2 +-
.../FreeSql.Provider.SqliteCore.csproj | 2 +-
.../FreeSql.Provider.Xugu.csproj | 2 +-
35 files changed, 73 insertions(+), 58 deletions(-)
diff --git a/Directory.Build.props b/Directory.Build.props
index d1062ccfa..6df7b6c81 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -11,7 +11,7 @@
diff --git a/Extensions/FreeSql.Extensions.AggregateRoot/FreeSql.Extensions.AggregateRoot.csproj b/Extensions/FreeSql.Extensions.AggregateRoot/FreeSql.Extensions.AggregateRoot.csproj
index 7c77d0801..d0ef5a636 100644
--- a/Extensions/FreeSql.Extensions.AggregateRoot/FreeSql.Extensions.AggregateRoot.csproj
+++ b/Extensions/FreeSql.Extensions.AggregateRoot/FreeSql.Extensions.AggregateRoot.csproj
@@ -18,7 +18,7 @@
true
key.snk
false
- 3.2.806-preview20231201
+ 3.2.806-preview20231204
readme.md
diff --git a/Extensions/FreeSql.Extensions.BaseEntity/FreeSql.Extensions.BaseEntity.csproj b/Extensions/FreeSql.Extensions.BaseEntity/FreeSql.Extensions.BaseEntity.csproj
index 62675139a..74f495836 100644
--- a/Extensions/FreeSql.Extensions.BaseEntity/FreeSql.Extensions.BaseEntity.csproj
+++ b/Extensions/FreeSql.Extensions.BaseEntity/FreeSql.Extensions.BaseEntity.csproj
@@ -19,7 +19,7 @@
key.snk
false
latest
- 3.2.806-preview20231201
+ 3.2.806-preview20231204
readme.md
diff --git a/Extensions/FreeSql.Extensions.JsonMap/FreeSql.Extensions.JsonMap.csproj b/Extensions/FreeSql.Extensions.JsonMap/FreeSql.Extensions.JsonMap.csproj
index 05f437a17..c733890af 100644
--- a/Extensions/FreeSql.Extensions.JsonMap/FreeSql.Extensions.JsonMap.csproj
+++ b/Extensions/FreeSql.Extensions.JsonMap/FreeSql.Extensions.JsonMap.csproj
@@ -18,7 +18,7 @@
true
key.snk
false
- 3.2.806-preview20231201
+ 3.2.806-preview20231204
readme.md
diff --git a/Extensions/FreeSql.Extensions.LazyLoading/FreeSql.Extensions.LazyLoading.csproj b/Extensions/FreeSql.Extensions.LazyLoading/FreeSql.Extensions.LazyLoading.csproj
index c8fa7e71f..d91170ab6 100644
--- a/Extensions/FreeSql.Extensions.LazyLoading/FreeSql.Extensions.LazyLoading.csproj
+++ b/Extensions/FreeSql.Extensions.LazyLoading/FreeSql.Extensions.LazyLoading.csproj
@@ -15,7 +15,7 @@
$(AssemblyName)
true
true
- 3.2.806-preview20231201
+ 3.2.806-preview20231204
readme.md
diff --git a/Extensions/FreeSql.Extensions.Linq/FreeSql.Extensions.Linq.csproj b/Extensions/FreeSql.Extensions.Linq/FreeSql.Extensions.Linq.csproj
index dd1b20e42..37d6d458f 100644
--- a/Extensions/FreeSql.Extensions.Linq/FreeSql.Extensions.Linq.csproj
+++ b/Extensions/FreeSql.Extensions.Linq/FreeSql.Extensions.Linq.csproj
@@ -18,7 +18,7 @@
true
key.snk
false
- 3.2.806-preview20231201
+ 3.2.806-preview20231204
readme.md
diff --git a/Extensions/FreeSql.Generator/FreeSql.Generator.csproj b/Extensions/FreeSql.Generator/FreeSql.Generator.csproj
index 348ca41a8..dc01ec5f1 100644
--- a/Extensions/FreeSql.Generator/FreeSql.Generator.csproj
+++ b/Extensions/FreeSql.Generator/FreeSql.Generator.csproj
@@ -13,7 +13,7 @@
https://github.com/2881099/FreeSql
https://github.com/2881099/FreeSql
FreeSql DbFirst 实体生成器
- 3.2.806-preview20231201
+ 3.2.806-preview20231204
readme.md
diff --git a/FreeSql.All/FreeSql.All.csproj b/FreeSql.All/FreeSql.All.csproj
index 2ed5c9c93..1c0de9479 100644
--- a/FreeSql.All/FreeSql.All.csproj
+++ b/FreeSql.All/FreeSql.All.csproj
@@ -17,7 +17,7 @@
true
key.snk
false
- 3.2.806-preview20231201
+ 3.2.806-preview20231204
readme.md
diff --git a/FreeSql.DbContext/FreeSql.DbContext.csproj b/FreeSql.DbContext/FreeSql.DbContext.csproj
index 5efa7a3fd..d21f97774 100644
--- a/FreeSql.DbContext/FreeSql.DbContext.csproj
+++ b/FreeSql.DbContext/FreeSql.DbContext.csproj
@@ -17,7 +17,7 @@
true
key.snk
false
- 3.2.806-preview20231201
+ 3.2.806-preview20231204
readme.md
diff --git a/FreeSql.DbContext/FreeSql.DbContext.xml b/FreeSql.DbContext/FreeSql.DbContext.xml
index 26522f106..594fbad32 100644
--- a/FreeSql.DbContext/FreeSql.DbContext.xml
+++ b/FreeSql.DbContext/FreeSql.DbContext.xml
@@ -733,15 +733,6 @@
-
-
- 根据Assembly扫描所有继承IEntityTypeConfiguration<T>的配置类
-
-
-
-
-
-
创建普通数据上下文档对象
@@ -800,14 +791,5 @@
-
-
- 批量注入 Repository,可以参考代码自行调整
-
-
-
-
-
-
diff --git a/FreeSql.Repository/FreeSql.Repository.csproj b/FreeSql.Repository/FreeSql.Repository.csproj
index a1e3e3334..adc23ddfb 100644
--- a/FreeSql.Repository/FreeSql.Repository.csproj
+++ b/FreeSql.Repository/FreeSql.Repository.csproj
@@ -17,7 +17,7 @@
true
key.snk
false
- 3.2.806-preview20231201
+ 3.2.806-preview20231204
readme.md
diff --git a/FreeSql/Extensions/FreeSqlGlobalExpressionCallExtensions.cs b/FreeSql/Extensions/FreeSqlGlobalExpressionCallExtensions.cs
index d59868b77..62d242ee8 100644
--- a/FreeSql/Extensions/FreeSqlGlobalExpressionCallExtensions.cs
+++ b/FreeSql/Extensions/FreeSqlGlobalExpressionCallExtensions.cs
@@ -162,13 +162,18 @@ static bool InternalRawSql([RawValue] string sql)
expContext.Value.Result = sql;
return false;
}
+ static object InternalRawField([RawValue] string sql)
+ {
+ expContext.Value.Result = sql;
+ return default;
+ }
- #region 大小判断
- ///
- /// 大于 >
- ///
- ///
- public static bool GreaterThan(TValue value1, TValue value2)
+ #region 大小判断
+ ///
+ /// 大于 >
+ ///
+ ///
+ public static bool GreaterThan(TValue value1, TValue value2)
{
expContext.Value.Result = $"{expContext.Value.ParsedContent["value1"]} > {expContext.Value.ParsedContent["value2"]}";
return false;
diff --git a/FreeSql/FreeSql.csproj b/FreeSql/FreeSql.csproj
index 44a6783e5..d21c48de8 100644
--- a/FreeSql/FreeSql.csproj
+++ b/FreeSql/FreeSql.csproj
@@ -17,7 +17,7 @@
true
key.snk
false
- 3.2.806-preview20231201
+ 3.2.806-preview20231204
readme.md
diff --git a/FreeSql/Internal/CommonProvider/SelectProvider/Select0Provider.cs b/FreeSql/Internal/CommonProvider/SelectProvider/Select0Provider.cs
index bd6e2e13f..6b00724b7 100644
--- a/FreeSql/Internal/CommonProvider/SelectProvider/Select0Provider.cs
+++ b/FreeSql/Internal/CommonProvider/SelectProvider/Select0Provider.cs
@@ -281,7 +281,9 @@ public SelectTableInfo GetOutsideSelectTable(ParameterExpression parameterExp)
}
}
- public Expression ConvertStringPropertyToExpression(string property, bool fromFirstTable = false)
+ public static MethodInfo _methodSqlExtInternalRawField = typeof(SqlExt).GetMethod("InternalRawField", BindingFlags.NonPublic | BindingFlags.Static);
+ public static MethodInfo _methodSqlExtInternalRawSql = typeof(SqlExt).GetMethod("InternalRawSql", BindingFlags.NonPublic | BindingFlags.Static);
+ public Expression ConvertStringPropertyToExpression(string property, bool fromFirstTable = false)
{
if (string.IsNullOrEmpty(property)) return null;
var field = property.Split('.').Select(a => a.Trim()).ToArray();
@@ -289,7 +291,16 @@ public Expression ConvertStringPropertyToExpression(string property, bool fromFi
if (field.Length == 1 && fromFirstTable == false)
{
- foreach (var tb in _tables)
+ if (_tables.Count == 1 && _tables[0].Table?.Type == typeof(object))
+ {
+ //配合 .Select