Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ ISymbol symbolForDiagnostic
symbolForDiagnostic
.DeclaringSyntaxReferences.FirstOrDefault()
?.GetSyntax()
.GetLocation() ?? Location.None,
.GetLocation()
?? Location.None,
symbol.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat)
)
);
Expand All @@ -217,7 +218,8 @@ ISymbol symbolForDiagnostic
symbolForDiagnostic
.DeclaringSyntaxReferences.FirstOrDefault()
?.GetSyntax()
.GetLocation() ?? Location.None,
.GetLocation()
?? Location.None,
containingType.ToDisplayString(
SymbolDisplayFormat.CSharpShortErrorMessageFormat
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ ParameterView parameters
var serverComponent = new ServerComponent(
sequence,
key,
rootComponent.Assembly.GetName().Name
?? throw new InvalidOperationException(
rootComponent.Assembly.GetName().Name ?? throw new InvalidOperationException(
"Cannot prerender components from assemblies with a null name"
),
rootComponent.FullName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ ParameterView parameters
)
{
var assembly =
type.Assembly.GetName().Name
?? throw new InvalidOperationException(
type.Assembly.GetName().Name ?? throw new InvalidOperationException(
"Cannot prerender components from assemblies with a null name"
);
var typeFullName =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ parentExpression is LiteralExpressionSyntax
var indentationLength =
parentSourceText
.Lines.GetLineFromPosition(parentExpression.Span.End)
.GetFirstNonWhitespaceOffset() ?? 0;
.GetFirstNonWhitespaceOffset()
?? 0;

// Create a source-text view over the token. This makes it very easy to treat the token as a set of lines
// that can be processed sensibly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public static void Main(string[] args)
var runtimeVersion =
typeof(object)
.Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
?.InformationalVersion ?? "Unknown";
?.InformationalVersion
?? "Unknown";
Console.WriteLine($"NetCoreAppVersion: {runtimeVersion}");

InteropClient.Run(args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ public void Configure(IApplicationBuilder app, IHostApplicationLifetime applicat
var runtimeVersion =
typeof(object)
.Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
?.InformationalVersion ?? "Unknown";
?.InformationalVersion
?? "Unknown";
Console.WriteLine($"NetCoreAppVersion: {runtimeVersion}");
var aspNetCoreVersion =
typeof(HeaderNames)
.Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
?.InformationalVersion ?? "Unknown";
?.InformationalVersion
?? "Unknown";
Console.WriteLine($"AspNetCoreAppVersion: {aspNetCoreVersion}");
});

Expand Down
3 changes: 2 additions & 1 deletion aspnetcore/src/Grpc/JsonTranscoding/src/Shared/Legacy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,8 @@ private static Dictionary<object, string> GetNameMapping(Type enumType)
f.GetCustomAttributes<OriginalNameAttribute>()
.FirstOrDefault()
// If the attribute hasn't been applied, fall back to the name of the field.
?.Name ?? f.Name
?.Name
?? f.Name
);
}
}
Expand Down
3 changes: 2 additions & 1 deletion aspnetcore/src/OpenApi/src/OpenApiGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,8 @@ bool disableInferredBody
.GetCustomAttributes()
.OfType<IFromBodyMetadata>()
.SingleOrDefault()
?.AllowEmpty ?? false;
?.AllowEmpty
?? false;
var isOptional =
requestBodyParameter.HasDefaultValue
|| nullability.ReadState != NullabilityState.NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ public override CookieOptions Build(HttpContext context, DateTimeOffset expiresF
if (path == null)
{
var originalPathBase =
context.Features.Get<IAuthenticationFeature>()?.OriginalPathBase
?? context.Request.PathBase;
context.Features.Get<IAuthenticationFeature>()?.OriginalPathBase ?? context
.Request
.PathBase;
path = originalPathBase + AdditionalPath;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,8 @@ public Task HttpsHelloWorld(HttpContext ctx) =>
public Task BodyLimit(HttpContext ctx) =>
ctx.Response.WriteAsync(
ctx.Features.Get<IHttpMaxRequestBodySizeFeature>()
?.MaxRequestBodySize?.ToString(CultureInfo.InvariantCulture) ?? "null"
?.MaxRequestBodySize?.ToString(CultureInfo.InvariantCulture)
?? "null"
);

public Task Anonymous(HttpContext context) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2413,7 +2413,8 @@ is IStatefulReconnectFeature feature
hubConnection._protocol,
_hubConnection
._serviceProvider.GetService<IOptions<HubConnectionOptions>>()
?.Value.StatefulReconnectBufferSize ?? DefaultStatefulReconnectBufferSize,
?.Value.StatefulReconnectBufferSize
?? DefaultStatefulReconnectBufferSize,
_logger
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ ISymbol symbolForDiagnostic
symbolForDiagnostic
.DeclaringSyntaxReferences.FirstOrDefault()
?.GetSyntax()
.GetLocation() ?? Location.None,
.GetLocation()
?? Location.None,
symbol.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat)
)
);
Expand All @@ -217,7 +218,8 @@ ISymbol symbolForDiagnostic
symbolForDiagnostic
.DeclaringSyntaxReferences.FirstOrDefault()
?.GetSyntax()
.GetLocation() ?? Location.None,
.GetLocation()
?? Location.None,
containingType.ToDisplayString(
SymbolDisplayFormat.CSharpShortErrorMessageFormat
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,30 @@













entryPointFullTypeName: "$([System.String]::Copy('$(StartupObject)').Trim())"













<![CDATA[
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2230,7 +2230,8 @@ expression is null
arm.Body,
expression
)
) ?? throw new NotImplementedException("Empty switch statement")
)
?? throw new NotImplementedException("Empty switch statement")
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2777,8 +2777,10 @@ bool isCollection
{
var jsonColumnName = entityType.GetContainerColumnName()!;
var jsonColumnTypeMapping = (
entityType.GetViewOrTableMappings().SingleOrDefault()?.Table
?? entityType.GetDefaultMappings().Single().Table
entityType.GetViewOrTableMappings().SingleOrDefault()?.Table ?? entityType
.GetDefaultMappings()
.Single()
.Table
)
.FindColumn(jsonColumnName)!
.StoreTypeMapping;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1680,7 +1680,8 @@ typeReference.StructuralType is not IEntityType entityType
entityType
.GetViewOrTableMappings()
.SingleOrDefault(e => e.IsSplitEntityTypePrincipal ?? true)
?.Table ?? entityType.GetDefaultMappings().Single().Table;
?.Table
?? entityType.GetDefaultMappings().Single().Table;
if (!table.IsOptional(entityType))
{
return propertyAccess;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ bool nullable
entityType
.GetViewOrTableMappings()
.SingleOrDefault(e => e.IsSplitEntityTypePrincipal ?? true)
?.Table ?? entityType.GetDefaultMappings().Single().Table;
?.Table
?? entityType.GetDefaultMappings().Single().Table;
if (table.IsOptional(entityType))
{
// Optional dependent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -838,8 +838,10 @@ RelationalTypeMapping identifierColumnTypeMapping
}

var table =
entityType.GetViewOrTableMappings().SingleOrDefault()?.Table
?? entityType.GetDefaultMappings().Single().Table;
entityType.GetViewOrTableMappings().SingleOrDefault()?.Table ?? entityType
.GetDefaultMappings()
.Single()
.Table;

// TODO: We'll need to make sure this is correct when we add support for JSON complex types.
var tableMap = new Dictionary<ITableBase, TableReferenceExpression>
Expand Down Expand Up @@ -951,8 +953,10 @@ var ownedJsonNavigation in GetAllNavigationsInHierarchy(entityType)
var targetEntityType = ownedJsonNavigation.TargetEntityType;
var containerColumnName = targetEntityType.GetContainerColumnName()!;
var containerColumn = (
entityType.GetViewOrTableMappings().SingleOrDefault()?.Table
?? entityType.GetDefaultMappings().Single().Table
entityType.GetViewOrTableMappings().SingleOrDefault()?.Table ?? entityType
.GetDefaultMappings()
.Single()
.Table
).FindColumn(containerColumnName)!;
var containerColumnTypeMapping = containerColumn.StoreTypeMapping;
var isNullable =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public CommandBatchPreparer(CommandBatchPreparerDependencies dependencies)
dependencies
.Options.Extensions.OfType<RelationalOptionsExtension>()
.FirstOrDefault()
?.MinBatchSize ?? 1;
?.MinBatchSize
?? 1;

_modificationCommandGraph = new Multigraph<IReadOnlyModificationCommand, CommandDependency>(
dependencies.ModificationCommandComparer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ ISqlExpressionFactory sqlExpressionFactory
var typeMapping =
Microsoft.EntityFrameworkCore.Query.ExpressionExtensions.InferTypeMapping(
candidates.ToArray()
) ?? _typeMappingSource.FindMapping(typeof(HierarchyId))!;
)
?? _typeMappingSource.FindMapping(typeof(HierarchyId))!;

var newArguments = new List<SqlExpression>();
for (var i = 0; i < arguments.Count; i++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,8 @@ public static bool CanSetIdentityColumnSeed(
SqlServerAnnotationNames.IdentitySeed,
seed,
fromDataAnnotation
) ?? true;
)
?? true;

/// <summary>
/// Configures the increment for SQL Server IDENTITY.
Expand Down Expand Up @@ -654,7 +655,8 @@ public static bool CanSetIdentityColumnIncrement(
SqlServerAnnotationNames.IdentityIncrement,
increment,
fromDataAnnotation
) ?? true;
)
?? true;

/// <summary>
/// Configures the value generation strategy for the key property, when targeting SQL Server.
Expand Down Expand Up @@ -820,7 +822,8 @@ public static bool CanSetValueGenerationStrategy(
SqlServerAnnotationNames.ValueGenerationStrategy,
valueGenerationStrategy,
fromDataAnnotation
) ?? true
)
?? true
);

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ IDbContextOptions options

_maxBatchSize = Math.Min(
options.Extensions.OfType<SqlServerOptionsExtension>().FirstOrDefault()?.MaxBatchSize
?? DefaultMaxBatchSize,
?? DefaultMaxBatchSize,
MaxMaxBatchSize
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ private static void FindExtension()
var rids =
DependencyContext
.Default!.RuntimeGraph.FirstOrDefault(g => g.Runtime == rid)
?.Fallbacks.ToList() ?? new List<string?>();
?.Fallbacks.ToList()
?? new List<string?>();
rids.Insert(0, rid);

foreach (var library in DependencyContext.Default.RuntimeLibraries)
Expand Down
3 changes: 2 additions & 1 deletion efcore/src/EFCore/ChangeTracking/ChangeTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ IEntityEntryGraphIterator graphIterator
.GetService<IDbContextOptions>()
.Extensions.OfType<CoreOptionsExtension>()
.FirstOrDefault()
?.QueryTrackingBehavior ?? QueryTrackingBehavior.TrackAll;
?.QueryTrackingBehavior
?? QueryTrackingBehavior.TrackAll;

_queryTrackingBehavior = _defaultQueryTrackingBehavior;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ invertedRelationshipBuilder is not null
|| (
foreignKey
.DeclaringEntityType.FindPrimaryKey()
?.Properties.All(p => !p.IsShadowProperty()) ?? false
?.Properties.All(p => !p.IsShadowProperty())
?? false
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1847,12 +1847,14 @@ protected void AddInstanceMethods(
typeTuple
.Value.Mutable.GetMethods(PublicInstance)
.Where(m => !IsObsolete(m))
.ToArray() ?? new MethodInfo[0];
.ToArray()
?? new MethodInfo[0];
var conventionMethods =
typeTuple
.Value.Convention.GetMethods(PublicInstance)
.Where(m => !IsObsolete(m))
.ToArray() ?? new MethodInfo[0];
.ToArray()
?? new MethodInfo[0];
var conventionBuilderMethods =
typeTuple
.Value.ConventionBuilder?.GetMethods(PublicInstance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1912,7 +1912,7 @@ from l3 in l1.OneToOne_Required_FK1.OneToMany_Optional2.DefaultIfEmpty()
ss =>
from l1 in ss.Set<Level1>()
from l3 in l1.OneToOne_Required_FK1.OneToMany_Optional2.DefaultIfEmpty()
?? new List<Level3>()
?? new List<Level3>()
where l3 != null
select l1
);
Expand Down Expand Up @@ -3318,7 +3318,7 @@ from l1 in ss.Set<Level1>()
{
l1.Id,
Count = l1.OneToOne_Optional_FK1.OneToMany_Optional2.MaybeScalar(x => x.Count)
?? 0,
?? 0,
},
elementSorter: e => e.Id
);
Expand Down
10 changes: 10 additions & 0 deletions mono/mcs/class/System.XML/Test/System.Xml/nist_dom/files/staff.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@













<![CDATA[This is a CDATASection with EntityReference number 2 &ent2;]]>

<![CDATA[This is an adjacent CDATASection with a reference to a tab &tab;]]>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ CancellationToken cancellationToken
GetSyntaxFacts()
.GetNameOfBaseNamespaceDeclaration(namespaceDeclaration)
?.GetDiagnostics()
.Any(d => d.Severity == DiagnosticSeverity.Error) ?? false;
.Any(d => d.Severity == DiagnosticSeverity.Error)
?? false;

if (isCurrentNamespaceInvalid)
{
Expand Down
Loading