-
Notifications
You must be signed in to change notification settings - Fork 861
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 增加 FreeSql.Provider.PostgreSQL NetTopologySuite 类型映射,保留 LegacyPostg…
…is 映射 #369;
- Loading branch information
28810
authored and
28810
committed
Jul 12, 2020
1 parent
8e14759
commit f2fba67
Showing
9 changed files
with
569 additions
and
11 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
...der.PostgreSQL.NetTopologySuite/FreeSql.Tests.Provider.PostgreSQL.NetTopologySuite.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
|
||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0-preview-20191115-01" /> | ||
<PackageReference Include="xunit" Version="2.4.1" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\Extensions\FreeSql.Extensions.LazyLoading\FreeSql.Extensions.LazyLoading.csproj" /> | ||
<ProjectReference Include="..\..\FreeSql.DbContext\FreeSql.DbContext.csproj" /> | ||
<ProjectReference Include="..\..\FreeSql\FreeSql.csproj" /> | ||
<ProjectReference Include="..\..\Providers\FreeSql.Provider.PostgreSQL\FreeSql.Provider.PostgreSQL.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
448 changes: 448 additions & 0 deletions
448
.../FreeSql.Tests.Provider.PostgreSQL.NetTopologySuite/PostgreSQL/PostgreSQLCodeFirstTest.cs
Large diffs are not rendered by default.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
FreeSql.Tests/FreeSql.Tests.Provider.PostgreSQL.NetTopologySuite/g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Npgsql; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Text; | ||
using System.Threading; | ||
|
||
public class g | ||
{ | ||
static Lazy<IFreeSql> pgsqlLazy = new Lazy<IFreeSql>(() => | ||
{ | ||
NpgsqlConnection.GlobalTypeMapper.UseNetTopologySuite(); | ||
return new FreeSql.FreeSqlBuilder() | ||
.UseConnectionString(FreeSql.DataType.PostgreSQL, "Host=192.168.164.10;Port=5432;Username=postgres;Password=123456;Database=tedb;Pooling=true;Maximum Pool Size=2") | ||
//.UseConnectionFactory(FreeSql.DataType.PostgreSQL, () => new Npgsql.NpgsqlConnection("Host=192.168.164.10;Port=5432;Username=postgres;Password=123456;Database=tedb;Pooling=true;")) | ||
.UseAutoSyncStructure(true) | ||
//.UseGenerateCommandParameterWithLambda(true) | ||
.UseNameConvert(FreeSql.Internal.NameConvertType.ToLower) | ||
.UseLazyLoading(true) | ||
.UseMonitorCommand( | ||
cmd => Trace.WriteLine("\r\n线程" + Thread.CurrentThread.ManagedThreadId + ": " + cmd.CommandText) //监听SQL命令对象,在执行前 | ||
//, (cmd, traceLog) => Console.WriteLine(traceLog) | ||
) | ||
.Build(); | ||
}); | ||
public static IFreeSql pgsql => pgsqlLazy.Value; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters