Skip to content

Commit 84f4864

Browse files
authored
Merge pull request #184 from servicetitan/upstream/SqlClient_4_compatibility
Compatibility with Microsoft.Data.SqlClient 4.x (#52); Update BitFaster.Caching to 1.0.4
2 parents 38d9090 + b37687b commit 84f4864

10 files changed

Lines changed: 24 additions & 13 deletions

File tree

Extensions/TestCommon/TestCommon.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.2" />
1212
<PackageReference Include="NUnit" Version="3.12.0" />
1313
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
14-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
14+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
1515
</ItemGroup>
1616
<ItemGroup>
1717
<ProjectReference Include="..\..\Orm\Xtensive.Orm.Tests.Framework\Xtensive.Orm.Tests.Framework.csproj" />

Extensions/Xtensive.Orm.Reprocessing/Xtensive.Orm.Reprocessing.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<AssemblyOriginatorKeyFile>$(ExtensionsKeyFile)</AssemblyOriginatorKeyFile>
1313
</PropertyGroup>
1414
<ItemGroup>
15-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
15+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
1616
</ItemGroup>
1717
<ItemGroup>
1818
<None Include="Readme.txt" />

Extensions/Xtensive.Orm.Security/Xtensive.Orm.Security.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</PropertyGroup>
1414
<Import Project="$(SolutionDir)MSBuild\DataObjects.Net.InternalBuild.targets" />
1515
<ItemGroup>
16-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
16+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
1717
</ItemGroup>
1818
<ItemGroup>
1919
<ProjectReference Include="..\..\Orm\Xtensive.Orm\Xtensive.Orm.csproj" />

Extensions/Xtensive.Orm.Tracking/Xtensive.Orm.Tracking.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<AssemblyOriginatorKeyFile>$(ExtensionsKeyFile)</AssemblyOriginatorKeyFile>
1313
</PropertyGroup>
1414
<ItemGroup>
15-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
15+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
1616
</ItemGroup>
1717
<ItemGroup>
1818
<ProjectReference Include="..\..\Orm\Xtensive.Orm\Xtensive.Orm.csproj" />

Extensions/Xtensive.Orm.Web/Xtensive.Orm.Web.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.2.0" />
2020
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.0" />
2121
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.0" />
22-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
22+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
2323
</ItemGroup>
2424
<ItemGroup>
2525
<ProjectReference Include="..\..\Orm\Xtensive.Orm\Xtensive.Orm.csproj" />

Orm/Xtensive.Orm.SqlServer/Sql.Drivers.SqlServer/DriverFactory.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ protected override string BuildConnectionString(UrlInfo url)
109109
SqlHelper.ValidateConnectionUrl(url);
110110

111111
var builder = new SqlConnectionStringBuilder();
112+
builder.Encrypt = url.Secure;
112113

113114
// host, port, database
114115
if (url.Port==0) {

Orm/Xtensive.Orm.Tests/Xtensive.Orm.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<PackageReference Include="NUnit" Version="3.12.0" />
1919
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
2020
<PackageReference Include="System.CodeDom" Version="4.4.0" />
21-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
21+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
2222
<PackageReference Include="System.Runtime.Serialization.Xml" Version="4.3.0" />
2323
<PackageReference Include="System.Spatial" Version="5.8.3" />
2424
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0.0" />

Orm/Xtensive.Orm/Caching/FastConcurrentLruCache{TKey, TItem}.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ public override TItem Add(TItem item, bool replaceIfExists)
5353
public override void RemoveKey(TKey key, bool removeCompletely) => realCache.TryRemove(key);
5454

5555
/// <inheritdoc/>
56-
public override void Clear() =>
57-
//TODO: Change to imp.Clear() after updating BitFaster.Caching package to 1.0.4
58-
realCache = new FastConcurrentLru<TKey, TItem>((int) MaxSize);
56+
public override void Clear() => realCache.Clear();
5957

6058
/// <inheritdoc/>
6159
/// <exception cref="NotImplementedException"/>

Orm/Xtensive.Orm/Orm/UrlInfo.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2007-2020 Xtensive LLC.
1+
// Copyright (C) 2007-2021 Xtensive LLC.
22
// This code is distributed under MIT license terms.
33
// See the License.txt file in the project root for more information.
44
// Created by: Alex Yakunin
@@ -77,7 +77,7 @@ public class UrlInfo :
7777
ISerializable
7878
{
7979
private static readonly Regex Pattern = new Regex(
80-
@"^(?'proto'[^:]*)://" +
80+
@"^(?'proto'[^:]*[^sS])(?'secure'[sS]?)://" +
8181
@"((?'username'[^:@]*)" +
8282
@"(:(?'password'[^@]*))?@)?" +
8383
@"(?'host'[^:/]*)" +
@@ -88,6 +88,7 @@ public class UrlInfo :
8888

8989
private string url = string.Empty;
9090
private string protocol = string.Empty;
91+
private bool secure = false;
9192
private string host = string.Empty;
9293
private int port;
9394
private string resource = string.Empty;
@@ -116,6 +117,16 @@ public string Protocol
116117
get { return protocol; }
117118
}
118119

120+
/// <summary>
121+
/// Gets the security part of the current <see cref="Url"/>
122+
/// Scheme with 's' suffix is secure.
123+
/// </summary>
124+
public bool Secure
125+
{
126+
[DebuggerStepThrough]
127+
get => secure;
128+
}
129+
119130
/// <summary>
120131
/// Gets the host part of the current <see cref="Url"/>
121132
/// (e.g. <b>"localhost"</b> is the host part of the "tcp://admin:password@<b>localhost</b>/resource" URL).
@@ -237,6 +248,7 @@ private static void Parse(string url, UrlInfo info)
237248
info.resource = UrlDecode(result.Result("${resource}"));
238249
info.host = UrlDecode(result.Result("${host}"));
239250
info.protocol = UrlDecode(result.Result("${proto}"));
251+
info.secure = !string.IsNullOrEmpty(result.Result("${secure}"));
240252
info.port = @port;
241253
info.parameters = new ReadOnlyDictionary<string, string>(@params);
242254
}

Orm/Xtensive.Orm/Xtensive.Orm.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
</Content>
4141
</ItemGroup>
4242
<ItemGroup Label="Packages">
43-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.7.0" />
44-
<PackageReference Include="BitFaster.Caching" Version="1.0.3" />
43+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
44+
<PackageReference Include="BitFaster.Caching" Version="1.0.4" />
4545
</ItemGroup>
4646
<ItemGroup Label="T4GeneratorsUpdaters">
4747
<None Update="Arithmetic\Internal\PrimitiveArithmetics.tt">

0 commit comments

Comments
 (0)