Skip to content

Commit 30c92cf

Browse files
authored
Merge branch 'master' into upstream/covariantReturnTypes
2 parents 2321367 + a4e02e6 commit 30c92cf

255 files changed

Lines changed: 1377 additions & 2197 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.

ChangeLog/7.1.0-Beta-2-dev.txt

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
1+
[main] Obsolete CatalogHelper class has been removed
2+
[main] Obsolete ReacreateTableHint has been removed
3+
[main] Obsolete Session.SelectStorageNode() method is removed
4+
[main] Obsolete methods from ArrayExtensions, EnumerableExtensions and QueryableExtensions have been removed
5+
[main] Obsolete DeleteDataHint.PostCopy property has been removed
6+
[main] Obsolete QueryEndpoint's members have been removed
7+
[main] Obsolete Query's members have been removed
8+
[main] Obsolete members of DelayedScalarQuery<T> have been removed
9+
[main] Obsolete FieldInfo.IsDynalicallyDefined property's been removed (FieldInfo.IsDynamicallyDefined is still there)
10+
[main] Some EventArgs inheritors that were sealed classes transformed to read-only structures
11+
[main] DbCommandEventArgs became read-only structure
12+
[main] Xtensive.Sql.Dml.Extensions.IsNullReference() extension method is marked obsolete, use 'is null' operator instead
113
[main] BitFaster.Caching package reference is updated to 1.0.7
2-
[main] No error caused by ambiguity due to new IQueryable extension methods of .Net 6
14+
[main] No error caused by ambiguity due to new IQueryable extension methods of .Net 6
15+
[reprocessing] DomainBuildErrorEventArgs (not sealed) became read-only structure
16+
[reprocessing] ExecuteErrorEventArgs (not sealed) became read-only structure
17+
[tracking] TrackingCompletedEventArgs (sealed) became read-only structure
18+
[Web] Removed Obsolete SessionManager and StartupConfigurationExtension

Directory.Build.props

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,25 @@
4040
<PropertyGroup>
4141
<NoLogo>true</NoLogo>
4242
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
43-
<TargetFramework>net5.0</TargetFramework>
43+
<TargetFrameworks>$(TargetFrameworks)</TargetFrameworks> <!-- the property -->
44+
<TargetFrameworks Condition="'$(TargetFrameworks)'==''">$(DO_TargetFrameworks)</TargetFrameworks> <!-- env var -->
45+
<TargetFrameworks Condition="'$(TargetFrameworks)'==''">net5.0</TargetFrameworks> <!-- fallback to default -->
4446
<LangVersion>9.0</LangVersion>
4547
<SolutionDir Condition="$(SolutionDir) == ''">$([MSBuild]::EnsureTrailingSlash(
4648
$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildThisFileDirectory)', 'Orm.sln'))))</SolutionDir>
4749
<Configuration Condition="$(Configuration) == ''">Debug</Configuration>
4850
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
4951
<ArtifactsDir Condition="'$(ArtifactsDir)'==''">$(SolutionDir)_Build\</ArtifactsDir>
5052
<BaseIntermediateOutputPath>$(ArtifactsDir)obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
51-
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
53+
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\$(TargetFramework)\</IntermediateOutputPath>
5254
<BaseOutputPath>$(ArtifactsDir)bin\$(Configuration)\</BaseOutputPath>
5355
<BaseOutputPath Condition="$(MSBuildProjectName.Contains('Tests'))
5456
OR $(MSBuildProjectName) == 'TestCommon'
5557
OR $(MSBuildProjectName) == 'Xtensive.Orm.Manual'">$(ArtifactsDir)tests\$(Configuration)\</BaseOutputPath>
5658
<OutputPath>$(BaseOutputPath)lib\</OutputPath>
5759
<MSBuildProjectExtensionsPath>$(BaseIntermediateOutputPath)</MSBuildProjectExtensionsPath>
5860
<ProjectAssetsFile>$(MSBuildProjectExtensionsPath)project.assets.json</ProjectAssetsFile>
59-
<ProjectAssetsCacheFile>$(MSBuildProjectExtensionsPath)$(MSBuildProjectName).assets.cache</ProjectAssetsCacheFile>
61+
<ProjectAssetsCacheFile>$(MSBuildProjectExtensionsPath)$(TargetFramework)\$(MSBuildProjectName).assets.cache</ProjectAssetsCacheFile>
6062
<OrmKeyFile>$(SolutionDir)Orm\Orm.snk</OrmKeyFile>
6163
</PropertyGroup>
6264

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,14 @@ private void JoinViaIn(SqlStatement statement, SqlSelect select)
142142
var s = (SqlSelect) select.Clone();
143143
foreach (var column in columns) {
144144
var ex = SqlDml.Equals(s.From.Columns[column.Name], table.Columns[column.Name]);
145-
s.Where = s.Where.IsNullReference() ? ex : SqlDml.And(s.Where, ex);
145+
s.Where = s.Where is null ? ex : SqlDml.And(s.Where, ex);
146146
}
147147
var existingColumns = s.Columns.ToChainedBuffer();
148148
s.Columns.Clear();
149149
var columnToAdd = existingColumns.First(c => c.Name.Equals(columnInfo.Name, StringComparison.Ordinal));
150150
s.Columns.Add(columnToAdd);
151151
var @in = SqlDml.In(SqlDml.TableColumn(table, columnInfo.Name), s);
152-
where = where.IsNullReference() ? @in : SqlDml.And(where, @in);
152+
where = where is null ? @in : SqlDml.And(where, @in);
153153
columns.Add(columnInfo);
154154
}
155155

Extensions/Xtensive.Orm.Logging.NLog/Log.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2013-2020 Xtensive LLC.
1+
// Copyright (C) 2013-2022 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: Dmitri Maximov
@@ -17,37 +17,37 @@ public class Log : BaseLog
1717
{
1818
private readonly Logger target;
1919

20-
private static NLogLevel ConvertLevel(LogLevel level)
21-
{
22-
switch (level) {
23-
case LogLevel.Debug:
24-
return NLogLevel.Debug;
25-
case LogLevel.Error:
26-
return NLogLevel.Error;
27-
case LogLevel.FatalError:
28-
return NLogLevel.Fatal;
29-
case LogLevel.Warning:
30-
return NLogLevel.Warn;
31-
default:
32-
return NLogLevel.Info;
33-
}
34-
}
35-
3620
/// <inheritdoc/>
3721
public override bool IsLogged(LogLevel level)
3822
{
3923
return target.IsEnabled(ConvertLevel(level));
4024
}
4125

4226
/// <inheritdoc/>
43-
public override void Write(LogEventInfo info)
27+
public override void Write(in LogEventInfo info)
4428
{
4529
if (info.Exception!=null)
4630
target.Log(ConvertLevel(info.Level), info.Exception, info.FormattedMessage);
4731
else
4832
target.Log(ConvertLevel(info.Level), info.FormattedMessage);
4933
}
5034

35+
private static NLogLevel ConvertLevel(in LogLevel level)
36+
{
37+
switch (level) {
38+
case LogLevel.Debug:
39+
return NLogLevel.Debug;
40+
case LogLevel.Error:
41+
return NLogLevel.Error;
42+
case LogLevel.FatalError:
43+
return NLogLevel.Fatal;
44+
case LogLevel.Warning:
45+
return NLogLevel.Warn;
46+
default:
47+
return NLogLevel.Info;
48+
}
49+
}
50+
5151
/// <summary>
5252
/// Creates instance of <see cref="Log"/> class.
5353
/// </summary>
Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2014-2020 Xtensive LLC.
1+
// Copyright (C) 2014-2022 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: Alexey Kulakov
@@ -16,25 +16,7 @@ namespace Xtensive.Orm.Logging.log4net
1616
/// </summary>
1717
public class Log : BaseLog
1818
{
19-
private log4netLog target;
20-
21-
private Level ConvertLevel(LogLevel level)
22-
{
23-
switch (level) {
24-
case LogLevel.Debug:
25-
return Level.Debug;
26-
case LogLevel.Info:
27-
return Level.Info;
28-
case LogLevel.Warning:
29-
return Level.Warn;
30-
case LogLevel.Error:
31-
return Level.Error;
32-
case LogLevel.FatalError:
33-
return Level.Fatal;
34-
default:
35-
return Level.Info;
36-
}
37-
}
19+
private readonly log4netLog target;
3820

3921
/// <inheritdoc />
4022
public override bool IsLogged(LogLevel level)
@@ -43,11 +25,29 @@ public override bool IsLogged(LogLevel level)
4325
}
4426

4527
/// <inheritdoc />
46-
public override void Write(LogEventInfo info)
28+
public override void Write(in LogEventInfo info)
4729
{
4830
target.Logger.Log(target.Logger.GetType(), ConvertLevel(info.Level), info.FormattedMessage, info.Exception);
4931
}
5032

33+
private Level ConvertLevel(in LogLevel level)
34+
{
35+
switch (level) {
36+
case LogLevel.Debug:
37+
return Level.Debug;
38+
case LogLevel.Info:
39+
return Level.Info;
40+
case LogLevel.Warning:
41+
return Level.Warn;
42+
case LogLevel.Error:
43+
return Level.Error;
44+
case LogLevel.FatalError:
45+
return Level.Fatal;
46+
default:
47+
return Level.Info;
48+
}
49+
}
50+
5151
/// <summary>
5252
/// Creates instance of <see cref="Log"/> class.
5353
/// </summary>
@@ -57,6 +57,7 @@ public override void Write(LogEventInfo info)
5757
public Log(Assembly repositoryAssembly, string name)
5858
{
5959
target = log4netLogManager.GetLogger(repositoryAssembly, name);
60+
6061
}
6162
}
6263
}
Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
1-
using System;
1+
// Copyright (C) 2012-2022 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
4+
using System;
25

36
namespace Xtensive.Orm.Reprocessing
47
{
58
/// <summary>
69
/// Contains <see cref="ReprocessableDomainBuilder.Error"/> event data.
710
/// </summary>
8-
public class DomainBuildErrorEventArgs : EventArgs
11+
public readonly struct DomainBuildErrorEventArgs
912
{
13+
/// <summary>
14+
/// Gets the exception.
15+
/// </summary>
16+
public Exception Exception { get; }
17+
/// <summary>
18+
/// Gets the attempt number.
19+
/// </summary>
20+
public int Attempt { get; }
21+
1022
/// <summary>
1123
/// Initializes a new instance of the <see cref="DomainBuildErrorEventArgs"/> class.
1224
/// </summary>
@@ -17,14 +29,5 @@ public DomainBuildErrorEventArgs(Exception exception, int attempt)
1729
Exception = exception;
1830
Attempt = attempt;
1931
}
20-
21-
/// <summary>
22-
/// Gets the exception.
23-
/// </summary>
24-
public Exception Exception { get; private set; }
25-
/// <summary>
26-
/// Gets the attempt number.
27-
/// </summary>
28-
public int Attempt { get; private set; }
2932
}
3033
}

Extensions/Xtensive.Orm.Reprocessing/ExecuteErrorEventArgs.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,35 @@
1-
using System;
1+
// Copyright (C) 2012-2022 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
4+
5+
using System;
26

37
namespace Xtensive.Orm.Reprocessing
48
{
59
/// <summary>
610
/// Provides data for the <see cref="IExecuteActionStrategy.Error"/> event
711
/// </summary>
8-
public class ExecuteErrorEventArgs : EventArgs
12+
public readonly struct ExecuteErrorEventArgs
913
{
1014
/// <summary>
1115
/// Gets the attempt number of this task.
1216
/// </summary>
13-
public int Attempt { get; private set; }
17+
public int Attempt { get; }
1418

1519
/// <summary>
1620
/// Gets the exception of this task.
1721
/// </summary>
18-
public Exception Exception { get; private set; }
22+
public Exception Exception { get; }
1923

2024
/// <summary>
2125
/// Gets the session of this task. Session will have outer transaction.
2226
/// </summary>
23-
public Session Session { get; private set; }
27+
public Session Session { get; }
2428

2529
/// <summary>
2630
/// Gets the transaction of this task.
2731
/// </summary>
28-
public Transaction Transaction { get; private set; }
32+
public Transaction Transaction { get; }
2933

3034
/// <summary>
3135
/// Initializes a new instance of the <see cref="ExecuteErrorEventArgs"/> class.
@@ -42,4 +46,4 @@ public ExecuteErrorEventArgs(Exception exception, Session session, Transaction t
4246
Transaction = transaction;
4347
}
4448
}
45-
}
49+
}

Extensions/Xtensive.Orm.Security/Permission.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2011 Xtensive LLC.
1+
// Copyright (C) 2011 Xtensive LLC.
22
// All rights reserved.
33
// For conditions of distribution and use, see license.
44
// Created by: Dmitri Maximov
@@ -41,15 +41,15 @@ public abstract class Permission
4141
/// <inheritdoc/>
4242
public bool Equals(Permission other)
4343
{
44-
if (ReferenceEquals(null, other)) return false;
44+
if (other is null) return false;
4545
if (ReferenceEquals(this, other)) return true;
4646
return Equals(other.Type, Type) && other.CanRead.Equals(CanRead) && other.CanWrite.Equals(CanWrite) && Equals(other.Query, Query);
4747
}
4848

4949
/// <inheritdoc/>
5050
public override bool Equals(object obj)
5151
{
52-
if (ReferenceEquals(null, obj)) return false;
52+
if (obj is null) return false;
5353
if (ReferenceEquals(this, obj)) return true;
5454
if (obj.GetType() != typeof (Permission)) return false;
5555
return Equals((Permission) obj);
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2019-2020 Xtensive LLC.
1+
// Copyright (C) 2012-2022 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

@@ -10,17 +10,17 @@ namespace Xtensive.Orm.Tracking
1010
/// <summary>
1111
/// Event arguments for <see cref="ITrackingMonitor.TrackingCompleted"/> event.
1212
/// </summary>
13-
public sealed class TrackingCompletedEventArgs : EventArgs
13+
public readonly struct TrackingCompletedEventArgs
1414
{
1515
/// <summary>
1616
/// Gets session this changes occured in.
1717
/// </summary>
18-
public Session Session { get; private set; }
18+
public Session Session { get; }
1919

2020
/// <summary>
2121
/// Gets the changes.
2222
/// </summary>
23-
public IEnumerable<ITrackingItem> Changes { get; private set; }
23+
public IEnumerable<ITrackingItem> Changes { get; }
2424

2525
/// <summary>
2626
/// Initializes a new instance of the <see cref="TrackingCompletedEventArgs"/> class.
@@ -30,13 +30,8 @@ public sealed class TrackingCompletedEventArgs : EventArgs
3030
/// <param name="changes">The changes.</param>
3131
public TrackingCompletedEventArgs(Session session, IEnumerable<ITrackingItem> changes)
3232
{
33-
if (session==null)
34-
throw new ArgumentNullException("session");
35-
if (changes == null)
36-
throw new ArgumentNullException("changes");
37-
38-
Session = session;
39-
Changes = changes;
33+
Session = session ?? throw new ArgumentNullException("session");
34+
Changes = changes ?? throw new ArgumentNullException("changes");
4035
}
4136
}
4237
}

Extensions/Xtensive.Orm.Web/ApplicationBuilderExtensions.cs

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

0 commit comments

Comments
 (0)