Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/2881099/FreeSql
Browse files Browse the repository at this point in the history
  • Loading branch information
2881099 committed Dec 3, 2024
2 parents 0e7f684 + b9b9a00 commit 12d377c
Show file tree
Hide file tree
Showing 38 changed files with 103 additions and 123 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!--
经常出于版本交叉问题,暂时关闭,在每个项目上设置版本号
<PropertyGroup>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
</PropertyGroup>
-->

Expand Down
93 changes: 49 additions & 44 deletions Examples/base_entity/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,9 @@ static void Main(string[] args)

//.UseConnectionString(FreeSql.DataType.SqlServer, "Data Source=.;Integrated Security=True;Initial Catalog=freesqlTest;Pooling=true;Max Pool Size=3;TrustServerCertificate=true")
//.UseAdoConnectionPool(false)
//.UseConnectionString(FreeSql.DataType.PostgreSQL, "Host=127.0.0.1;Port=5432;Username=postgres;Password=123456;Database=tedb;Pooling=true;Maximum Pool Size=2")
.UseConnectionString(FreeSql.DataType.PostgreSQL, "Host=127.0.0.1;Port=5432;Username=postgres;Password=123456;Database=tedb;Pooling=true;Maximum Pool Size=2")
////.UseConnectionString(FreeSql.DataType.PostgreSQL, "Host=127.0.0.1;Port=5432;Username=postgres;Password=123456;Database=toc;Pooling=true;Maximum Pool Size=2")
//.UseNameConvert(FreeSql.Internal.NameConvertType.ToLower)
.UseNameConvert(FreeSql.Internal.NameConvertType.ToLower)

//.UseConnectionString(FreeSql.DataType.Oracle, "user id=user1;password=123456;data source=//127.0.0.1:1521/XE;Pooling=true;Max Pool Size=2")
//.UseNameConvert(FreeSql.Internal.NameConvertType.ToUpper)
Expand Down Expand Up @@ -619,6 +619,53 @@ static void Main(string[] args)
BaseEntity.Initialization(fsql, () => _asyncUow.Value);
#endregion


var dbpars = new List<DbParameter>();

var a1id1 = Guid.NewGuid();
var a1id2 = Guid.NewGuid();
//fsql.CodeFirst.IsGenerateCommandParameterWithLambda = true;
var sql1a0 = fsql.Select<User1>()
.WithParameters(dbpars)
.Where(a => a.Id == a1id1)
.OrderBy(a => a.Id)

.UnionAll(
fsql.Select<User1>()
.WithParameters(dbpars)
.Where(a => a.Id == a1id2)
.OrderByDescending(a => a.Id),

fsql.Select<User1>()
.WithParameters(dbpars)
.Where(a => a.Id == a1id2)
.OrderByDescending(a => a.Id)
)
.Where(a => a.Id == a1id1 || a.Id == a1id2)
.ToList();
var sql1a1 = fsql.Select<User1>()
.Where(a => a.Id == a1id1)
.UnionAll(
fsql.Select<User1>()
.Where(a => a.Id == a1id2)
)
.Where(a => a.Id == a1id1 || a.Id == a1id2)
.ToList();
var sql1a2 = fsql.Select<User1, UserGroup>()
.InnerJoin((a, b) => a.GroupId == b.Id)
.Where((a, b) => a.Id == a1id1)
.WithTempQuery((a, b) => new { user = a, group = b }) //匿名类型

.UnionAll(
fsql.Select<User1, UserGroup>()
.InnerJoin((a, b) => a.GroupId == b.Id)
.Where((a, b) => a.Id == a1id2)
.WithTempQuery((a, b) => new { user = a, group = b }) //匿名类型
)

.Where(a => a.user.Id == a1id1 || a.user.Id == a1id2)
.ToList();

fsql.Aop.AuditValue += (_, e) =>
{

Expand Down Expand Up @@ -1676,48 +1723,6 @@ static void Main(string[] args)
var sqlskdfj = fsql.Select<object>().AsType(typeof(BBB)).ToSql(a => new CCC());


var dbpars = new List<DbParameter>();

var a1id1 = Guid.NewGuid();
var a1id2 = Guid.NewGuid();
//fsql.CodeFirst.IsGenerateCommandParameterWithLambda = true;
var sql1a0 = fsql.Select<User1>()
.WithParameters(dbpars)
.Where(a => a.Id == a1id1)

.UnionAll(
fsql.Select<User1>()
.WithParameters(dbpars)
.Where(a => a.Id == a1id2),

fsql.Select<User1>()
.WithParameters(dbpars)
.Where(a => a.Id == a1id2)
)
.Where(a => a.Id == a1id1 || a.Id == a1id2)
.ToSql();
var sql1a1 = fsql.Select<User1>()
.Where(a => a.Id == a1id1)
.UnionAll(
fsql.Select<User1>()
.Where(a => a.Id == a1id2)
)
.Where(a => a.Id == a1id1 || a.Id == a1id2)
.ToSql();
var sql1a2 = fsql.Select<User1, UserGroup>()
.InnerJoin((a, b) => a.GroupId == b.Id)
.Where((a, b) => a.Id == a1id1)
.WithTempQuery((a, b) => new { user = a, group = b }) //匿名类型

.UnionAll(
fsql.Select<User1, UserGroup>()
.InnerJoin((a, b) => a.GroupId == b.Id)
.Where((a, b) => a.Id == a1id2)
.WithTempQuery((a, b) => new { user = a, group = b }) //匿名类型
)

.Where(a => a.user.Id == a1id1 || a.user.Id == a1id2)
.ToSql();


var ddlsql01 = fsql.CodeFirst.GetComparisonDDLStatements<StringNulable>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<LangVersion>latest</LangVersion>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Title>$(AssemblyName)</Title>
<IsPackable>true</IsPackable>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion Extensions/FreeSql.Generator/FreeSql.Generator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageProjectUrl>https://github.com/2881099/FreeSql</PackageProjectUrl>
<RepositoryUrl>https://github.com/2881099/FreeSql</RepositoryUrl>
<PackageTags>FreeSql DbFirst 实体生成器</PackageTags>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
19 changes: 17 additions & 2 deletions FreeSql-lite.sln
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FreeSql.Provider.Duckdb", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FreeSql.Tests.Provider.Duckdb", "FreeSql.Tests\FreeSql.Tests.Provider.Duckdb\FreeSql.Tests.Provider.Duckdb.csproj", "{B9787A81-D537-45ED-B413-61BF03C8FEBE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FreeSql.Provider.TDengine", "Providers\FreeSql.Provider.TDengine\FreeSql.Provider.TDengine.csproj", "{C89AFB35-AC56-4683-BCB5-13D3522DFED3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -537,6 +539,18 @@ Global
{B9787A81-D537-45ED-B413-61BF03C8FEBE}.Release|x64.Build.0 = Release|Any CPU
{B9787A81-D537-45ED-B413-61BF03C8FEBE}.Release|x86.ActiveCfg = Release|Any CPU
{B9787A81-D537-45ED-B413-61BF03C8FEBE}.Release|x86.Build.0 = Release|Any CPU
{C89AFB35-AC56-4683-BCB5-13D3522DFED3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C89AFB35-AC56-4683-BCB5-13D3522DFED3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C89AFB35-AC56-4683-BCB5-13D3522DFED3}.Debug|x64.ActiveCfg = Debug|Any CPU
{C89AFB35-AC56-4683-BCB5-13D3522DFED3}.Debug|x64.Build.0 = Debug|Any CPU
{C89AFB35-AC56-4683-BCB5-13D3522DFED3}.Debug|x86.ActiveCfg = Debug|Any CPU
{C89AFB35-AC56-4683-BCB5-13D3522DFED3}.Debug|x86.Build.0 = Debug|Any CPU
{C89AFB35-AC56-4683-BCB5-13D3522DFED3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C89AFB35-AC56-4683-BCB5-13D3522DFED3}.Release|Any CPU.Build.0 = Release|Any CPU
{C89AFB35-AC56-4683-BCB5-13D3522DFED3}.Release|x64.ActiveCfg = Release|Any CPU
{C89AFB35-AC56-4683-BCB5-13D3522DFED3}.Release|x64.Build.0 = Release|Any CPU
{C89AFB35-AC56-4683-BCB5-13D3522DFED3}.Release|x86.ActiveCfg = Release|Any CPU
{C89AFB35-AC56-4683-BCB5-13D3522DFED3}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -573,10 +587,11 @@ Global
{353F3732-0704-40F2-972B-036E9CC01881} = {2A381C57-2697-427B-9F10-55DA11FD02E4}
{4367B7AC-604F-4503-A1D4-643ADBFCF703} = {4A92E8A6-9A6D-41A1-9CDA-DE10899648AA}
{02CFB50A-D8C4-470D-AC93-5540D6029430} = {2A381C57-2697-427B-9F10-55DA11FD02E4}
{C89AFB35-AC56-4683-BCB5-13D3522DFED3} = {2A381C57-2697-427B-9F10-55DA11FD02E4}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {089687FA-5D21-40AC-BA8A-AA0D1E1H7F98}
RESX_PrefixTranslations = True
RESX_NeutralResourcesLanguage = en-US
RESX_PrefixTranslations = True
SolutionGuid = {089687FA-5D21-40AC-BA8A-AA0D1E1H7F98}
EndGlobalSection
EndGlobal
2 changes: 1 addition & 1 deletion FreeSql.All/FreeSql.All.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion FreeSql.DbContext/FreeSql.DbContext.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion FreeSql.Repository/FreeSql.Repository.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion FreeSql/FreeSql.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ public ISelect<T1> UnionAll(params ISelect<T1>[] querys)
querys = querys?.Where(q => q != null).ToArray();
if (querys?.Any() != true) return this;
var ret = (_orm as BaseDbProvider).CreateSelectProvider<T1>(null) as Select1Provider<T1>;
var sb = new StringBuilder().Append(LocalGetQuerySql(this));
var sb = new StringBuilder().Append(this._select).Append(" * from (").Append(LocalGetQuerySql(this)).Append(") ftb");
foreach (var select2 in querys)
sb.Append(" \r\nUNION ALL \r\n").Append(LocalGetQuerySql(select2));
sb.Append(" \r\nUNION ALL \r\nselect * from (").Append(LocalGetQuerySql(select2)).Append(") ftb");
ret.WithSql(sb.ToString());
sb.Clear();
ret._commandTimeout = _commandTimeout;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<SignAssembly>False</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Title>$(AssemblyName)</Title>
<IsPackable>true</IsPackable>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Title>$(AssemblyName)</Title>
<IsPackable>true</IsPackable>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<Version>3.5.100</Version>
<Version>3.5.101</Version>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
Loading

0 comments on commit 12d377c

Please sign in to comment.