Skip to content

Commit 7e58311

Browse files
committed
Updates following review
1 parent de874b7 commit 7e58311

7 files changed

+31
-31
lines changed

src/EFCore.Abstractions/DbFunctionAttribute.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System;
5+
using System.Diagnostics.CodeAnalysis;
56
using Microsoft.EntityFrameworkCore.Utilities;
6-
using CA = System.Diagnostics.CodeAnalysis;
77

88
namespace Microsoft.EntityFrameworkCore
99
{
@@ -48,7 +48,7 @@ public DbFunctionAttribute(string name, string? schema = null)
4848
/// <summary>
4949
/// The name of the function in the database.
5050
/// </summary>
51-
[CA.DisallowNullAttribute]
51+
[DisallowNull]
5252
public virtual string? Name
5353
{
5454
get => _name;

src/EFCore.Cosmos/Diagnostics/CosmosEventId.cs

+15-15
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@
66

77
namespace Microsoft.EntityFrameworkCore.Diagnostics
88
{
9-
/// <summary>
10-
/// <para>
11-
/// Event IDs for Cosmos events that correspond to messages logged to an <see cref="ILogger" />
12-
/// and events sent to a <see cref="DiagnosticSource" />.
13-
/// </para>
14-
/// <para>
15-
/// These IDs are also used with <see cref="WarningsConfigurationBuilder" /> to configure the
16-
/// behavior of warnings.
17-
/// </para>
18-
/// </summary>
19-
/// <remarks>
20-
/// See <see href="https://aka.ms/efcore-docs-diagnostics">Logging, events, and diagnostics</see>, and
21-
/// <see href="https://aka.ms/efcore-docs-cosmos">Accessing Azure Cosmos DB with EF Core</see> for more information.
22-
/// </remarks>
23-
public static class CosmosEventId
9+
/// <summary>
10+
/// <para>
11+
/// Event IDs for Cosmos events that correspond to messages logged to an <see cref="ILogger" />
12+
/// and events sent to a <see cref="DiagnosticSource" />.
13+
/// </para>
14+
/// <para>
15+
/// These IDs are also used with <see cref="WarningsConfigurationBuilder" /> to configure the
16+
/// behavior of warnings.
17+
/// </para>
18+
/// </summary>
19+
/// <remarks>
20+
/// See <see href="https://aka.ms/efcore-docs-diagnostics">Logging, events, and diagnostics</see>, and
21+
/// <see href="https://aka.ms/efcore-docs-cosmos">Accessing Azure Cosmos DB with EF Core</see> for more information.
22+
/// </remarks>
23+
public static class CosmosEventId
2424
{
2525
// Warning: These values must not change between releases.
2626
// Only add new values to the end of sections, never in the middle.

src/EFCore.Cosmos/Extensions/CosmosEntityTypeExtensions.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ public static class CosmosEntityTypeExtensions
2626
public static string? GetContainer(this IReadOnlyEntityType entityType)
2727
=> entityType.BaseType != null
2828
? entityType.GetRootType().GetContainer()
29-
: (string?)entityType[CosmosAnnotationNames.ContainerName]
30-
?? GetDefaultContainer(entityType);
29+
: ((string?)entityType[CosmosAnnotationNames.ContainerName]
30+
?? GetDefaultContainer(entityType));
3131

3232
private static string? GetDefaultContainer(IReadOnlyEntityType entityType)
3333
=> entityType.FindOwnership() != null
3434
? null
35-
: entityType.Model.GetDefaultContainer()
36-
?? entityType.ShortName();
35+
: (entityType.Model.GetDefaultContainer()
36+
?? entityType.ShortName());
3737

3838
/// <summary>
3939
/// Sets the name of the container to which the entity type is mapped.

src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.CosmosProjectionBindingRemovingExpressionVisitor.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ protected override ProjectionExpression GetProjection(ProjectionBindingExpressio
3232
private int GetProjectionIndex(ProjectionBindingExpression projectionBindingExpression)
3333
=> projectionBindingExpression.ProjectionMember != null
3434
? _selectExpression.GetMappedProjection(projectionBindingExpression.ProjectionMember).GetConstantValue<int>()
35-
: projectionBindingExpression.Index
36-
?? throw new InvalidOperationException(CoreStrings.TranslationFailed(projectionBindingExpression.Print()));
35+
: (projectionBindingExpression.Index
36+
?? throw new InvalidOperationException(CoreStrings.TranslationFailed(projectionBindingExpression.Print())));
3737
}
3838
}
3939
}

src/EFCore.Cosmos/Storage/Internal/CosmosExecutionStrategy.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ static bool IsTransient(HttpStatusCode statusCode)
122122
var baseDelay = base.GetNextDelay(lastException);
123123
return baseDelay == null
124124
? null
125-
: CallOnWrappedException(lastException, GetDelayFromException)
126-
?? baseDelay;
125+
: (CallOnWrappedException(lastException, GetDelayFromException)
126+
?? baseDelay);
127127
}
128128

129129
private static TimeSpan? GetDelayFromException(Exception exception)

src/EFCore.Cosmos/Storage/Internal/CosmosTypeMappingSource.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ public CosmosTypeMappingSource(TypeMappingSourceDependencies dependencies)
5050

5151
return _clrTypeMappings.TryGetValue(clrType, out var mapping)
5252
? mapping
53-
: FindPrimitiveMapping(mappingInfo)
54-
?? FindCollectionMapping(mappingInfo)
55-
?? base.FindMapping(mappingInfo);
53+
: (FindPrimitiveMapping(mappingInfo)
54+
?? FindCollectionMapping(mappingInfo)
55+
?? base.FindMapping(mappingInfo));
5656
}
5757

5858
private CoreTypeMapping? FindPrimitiveMapping(in TypeMappingInfo mappingInfo)

src/EFCore.Sqlite.Core/Query/Internal/SqliteSqlTranslatingExpressionVisitor.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,9 @@ protected override Expression VisitBinary(BinaryExpression binaryExpression)
316316
private static Type? GetProviderType(SqlExpression? expression)
317317
=> expression == null
318318
? null
319-
: expression.TypeMapping?.Converter?.ProviderClrType
320-
?? expression.TypeMapping?.ClrType
321-
?? expression.Type;
319+
: (expression.TypeMapping?.Converter?.ProviderClrType
320+
?? expression.TypeMapping?.ClrType
321+
?? expression.Type);
322322

323323
private static bool AreOperandsDecimals(SqlBinaryExpression sqlExpression)
324324
=> GetProviderType(sqlExpression.Left) == typeof(decimal)

0 commit comments

Comments
 (0)