Skip to content

Commit 2f59aa6

Browse files
authored
Revert "net5 compilation and delete obsolete code" (#200)
1 parent d739f7f commit 2f59aa6

333 files changed

Lines changed: 6495 additions & 1646 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Containers/do-sqlserver2019

Lines changed: 0 additions & 12 deletions
This file was deleted.

Directory.Build.props

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,12 @@
3232
<DoGeneratePackage Condition="$(MSBuildProjectName) == 'Xtensive.Orm.Manual'">false</DoGeneratePackage>
3333
<DoGeneratePackage Condition="$(MSBuildProjectName) == 'TestCommon'">false</DoGeneratePackage>
3434
<DoGeneratePackage Condition="$(MSBuildProjectName.Contains('Tests')) == 'true'">false</DoGeneratePackage>
35-
36-
<!-- Disable "BinaryFormatter is obsolete" warnings for test projects -->
37-
<NoWarn Condition="$(MSBuildProjectName.Contains('Tests')) == 'true'">$(NoWarn);SYSLIB0011</NoWarn>
3835
</PropertyGroup>
3936

4037
<PropertyGroup>
4138
<NoLogo>true</NoLogo>
4239
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
43-
<TargetFramework>net5.0</TargetFramework>
40+
<TargetFramework>netcoreapp3.1</TargetFramework>
4441
<LangVersion>9.0</LangVersion>
4542
<SolutionDir Condition="$(SolutionDir) == ''">$([MSBuild]::EnsureTrailingSlash(
4643
$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildThisFileDirectory)', 'Orm.sln'))))</SolutionDir>

Extensions/Xtensive.Orm.BulkOperations/Internals/SetOperation.cs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,16 @@ private void PreprocessStructures()
7373
ex = Expression.Call(
7474
typeof (Queryable), "Select", new[] {parameter.Type, f.ValueType}, ex, lambda);
7575
ex = Expression.Call(typeof (Queryable), call.Method.Name, new[] {f.ValueType}, ex);*/
76-
else {
76+
else
77+
{
7778
//ex = Expression.Convert(ex, typeof(Structure));
78-
var last = f;
79-
var fields = new List<FieldInfo> { last };
80-
while (last.Parent != setDescriptor.Field) {
81-
last = f.Parent;
82-
fields.Add(last);
83-
}
79+
var list = new List<FieldInfo> { f };
80+
while (list.Last().Parent != setDescriptor.Field)
81+
list.Add(f.Parent);
82+
list.Reverse();
8483
Expression member = ex;
85-
for (var i = fields.Count; i-- > 0;) {
86-
member = Expression.MakeMemberAccess(member, fields[i].UnderlyingProperty);
87-
}
84+
foreach (FieldInfo f2 in list)
85+
member = Expression.MakeMemberAccess(member, f2.UnderlyingProperty);
8886
ex = member;
8987
}
9088
Descriptors.Add(new SetDescriptor(f, setDescriptor.Parameter, ex));

Extensions/Xtensive.Orm.Reprocessing/ExecuteActionStrategy.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ namespace Xtensive.Orm.Reprocessing
1111
/// </summary>
1212
public abstract class ExecuteActionStrategy : IExecuteActionStrategy
1313
{
14-
private static readonly ConcurrentDictionary<Type, Lazy<IExecuteActionStrategy>> Singletons =
15-
new ConcurrentDictionary<Type, Lazy<IExecuteActionStrategy>>();
14+
private static readonly ConcurrentDictionary<Type, IExecuteActionStrategy> Singletons =
15+
new ConcurrentDictionary<Type, IExecuteActionStrategy>();
1616

1717
/// <summary>
1818
/// Gets singleton of the <see cref="HandleReprocessableExceptionStrategy"/>.
@@ -137,13 +137,7 @@ public static IExecuteActionStrategy GetSingleton(Type type)
137137
if (type == typeof(NoReprocessStrategy)) {
138138
return NoReprocess;
139139
}
140-
141-
return Singletons.GetOrAdd(type, ActionStrategyFactory).Value;
142-
143-
static Lazy<IExecuteActionStrategy> ActionStrategyFactory(Type t)
144-
{
145-
return new Lazy<IExecuteActionStrategy>(() => (IExecuteActionStrategy) Activator.CreateInstance(t));
146-
}
140+
return Singletons.GetOrAdd(type, a => (IExecuteActionStrategy) Activator.CreateInstance(type));
147141
}
148142

149143
#region Non-public methods

Extensions/Xtensive.Orm.Security/Role.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Xtensive.Orm.Security
1111
public abstract class Role : Entity, IRole
1212
{
1313
private List<Permission> permissions;
14-
private IList<Permission> readOnlyPermissions;
14+
private ReadOnlyList<Permission> readOnlyPermissions;
1515

1616
/// <inheritdoc/>
1717
[NotNullConstraint(IsImmediate = true)]
@@ -57,7 +57,7 @@ protected override void OnInitialize()
5757
{
5858
base.OnInitialize();
5959
permissions = new List<Permission>();
60-
readOnlyPermissions = permissions.AsReadOnly();
60+
readOnlyPermissions = new ReadOnlyList<Permission>(permissions);
6161
RegisterPermissions();
6262
}
6363

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
45
<IsPackable>false</IsPackable>
56
<SignAssembly>true</SignAssembly>
67
<AssemblyOriginatorKeyFile>$(ExtensionsKeyFile)</AssemblyOriginatorKeyFile>
7-
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
8-
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
98
</PropertyGroup>
109
<Import Project="$(SolutionDir)MSBuild\DataObjects.Net.InternalBuild.targets" />
1110
<ItemGroup>

Extensions/Xtensive.Orm.Web/SessionManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public static SessionManager Demand()
7575
/// </summary>
7676
public bool HasSession
7777
{
78-
get { return sessionAndTransactionPair.Value.First != null; }
78+
get { return sessionAndTransactionPair.Value != null && sessionAndTransactionPair.Value.First != null; }
7979
}
8080

8181
/// <summary>

Orm/Xtensive.Orm.Firebird/Orm.Providers.Firebird/DomainHandler.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ namespace Xtensive.Orm.Providers.Firebird
1313
/// </summary>
1414
public class DomainHandler : Providers.DomainHandler
1515
{
16-
/// <inheritdoc/>
1716
protected override ICompiler CreateCompiler(CompilerConfiguration configuration)
1817
{
1918
return new SqlCompiler(Handlers, configuration);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ protected override SqlDriver CreateDriver(string connectionString, SqlDriverConf
4242
connectionString, GetVersionFromServerVersionString(connection.ServerVersion), defaultSchema);
4343
}
4444

45-
/// <inheritdoc/>
4645
protected override async Task<SqlDriver> CreateDriverAsync(
4746
string connectionString, SqlDriverConfiguration configuration, CancellationToken token)
4847
{

Orm/Xtensive.Orm.Firebird/Sql.Drivers.Firebird/v2_5/ServerInfoProvider.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ internal class ServerInfoProvider : Info.ServerInfoProvider
1717
// The limit is 64kB for statement text, 64kB for compiled BLR and 48kB for execution plan.
1818
private const int MaxTextLength = int.MaxValue;
1919

20+
private readonly string databaseName;
21+
private readonly string defaultSchemaName;
22+
2023
public override EntityInfo GetCollationInfo()
2124
{
2225
return null;

0 commit comments

Comments
 (0)