Skip to content

Commit 847bf3d

Browse files
authored
Activate nullability for all product code (#24406)
* Enable nullability warnings as errors * Remove all individual file #nullable enable Part of #19007
1 parent af2b6ef commit 847bf3d

File tree

1,688 files changed

+2
-3360
lines changed

Some content is hidden

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

1,688 files changed

+2
-3360
lines changed

Diff for: Directory.Build.props

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
<PackageTags>Entity Framework Core;entity-framework-core;EF;Data;O/RM;EntityFramework;EntityFrameworkCore;EFCore</PackageTags>
2222
<Product>Microsoft Entity Framework Core</Product>
2323
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
24-
<WarningsNotAsErrors>nullable</WarningsNotAsErrors>
2524
<LangVersion>9.0</LangVersion>
2625
<DebugType>portable</DebugType>
2726
<PackageProjectUrl>https://docs.microsoft.com/ef/core/</PackageProjectUrl>

Diff for: src/Directory.Build.props

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<IsPackable>True</IsPackable>
77
<IncludeSymbols>True</IncludeSymbols>
88
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)..\rulesets\EFCore.ruleset</CodeAnalysisRuleSet>
9+
<Nullable>enable</Nullable>
910
</PropertyGroup>
1011

1112
<ItemGroup>

Diff for: src/EFCore.Abstractions/EFCore.Abstractions.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<AssemblyName>Microsoft.EntityFrameworkCore.Abstractions</AssemblyName>
88
<RootNamespace>Microsoft.EntityFrameworkCore</RootNamespace>
99
<GenerateDocumentationFile>true</GenerateDocumentationFile>
10-
<Nullable>enable</Nullable>
1110
</PropertyGroup>
1211

1312
<ItemGroup>

Diff for: src/EFCore.Analyzers/EFCore.Analyzers.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<RootNamespace>Microsoft.EntityFrameworkCore</RootNamespace>
88
<IncludeBuildOutput>false</IncludeBuildOutput>
99
<NuspecFile>$(MSBuildProjectName).nuspec</NuspecFile>
10-
<Nullable>enable</Nullable>
1110
</PropertyGroup>
1211

1312
<ItemGroup>

Diff for: src/EFCore.Cosmos/Diagnostics/CosmosEventId.cs

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
using System.Diagnostics;
55
using Microsoft.Extensions.Logging;
66

7-
#nullable enable
8-
97
namespace Microsoft.EntityFrameworkCore.Diagnostics
108
{
119
/// <summary>

Diff for: src/EFCore.Cosmos/Diagnostics/CosmosQueryEventData.cs

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
using System.Diagnostics;
77
using JetBrains.Annotations;
88

9-
#nullable enable
10-
119
namespace Microsoft.EntityFrameworkCore.Diagnostics
1210
{
1311
/// <summary>

Diff for: src/EFCore.Cosmos/Diagnostics/CosmosReadItemEventData.cs

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
using System.Diagnostics;
66
using JetBrains.Annotations;
77

8-
#nullable enable
9-
108
namespace Microsoft.EntityFrameworkCore.Diagnostics
119
{
1210
/// <summary>

Diff for: src/EFCore.Cosmos/Diagnostics/Internal/CosmosLoggerExtensions.cs

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
using Newtonsoft.Json;
1414
using Newtonsoft.Json.Linq;
1515

16-
#nullable enable
17-
1816
// ReSharper disable once CheckNamespace
1917
namespace Microsoft.EntityFrameworkCore.Cosmos.Diagnostics.Internal
2018
{

Diff for: src/EFCore.Cosmos/Diagnostics/Internal/CosmosLoggingDefinitions.cs

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
using Microsoft.EntityFrameworkCore.Diagnostics;
55

6-
#nullable enable
7-
86
namespace Microsoft.EntityFrameworkCore.Cosmos.Diagnostics.Internal
97
{
108
/// <summary>

Diff for: src/EFCore.Cosmos/EFCore.Cosmos.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<RootNamespace>Microsoft.EntityFrameworkCore.Cosmos</RootNamespace>
99
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1010
<PackageTags>$(PackageTags);CosmosDb;SQL API</PackageTags>
11-
<Nullable>enable</Nullable>
1211
</PropertyGroup>
1312

1413
<ItemGroup>

Diff for: src/EFCore.Cosmos/Extensions/CosmosDatabaseFacadeExtensions.cs

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
using Microsoft.EntityFrameworkCore.Utilities;
1212
using Microsoft.Extensions.DependencyInjection;
1313

14-
#nullable enable
15-
1614
// ReSharper disable once CheckNamespace
1715
namespace Microsoft.EntityFrameworkCore
1816
{

Diff for: src/EFCore.Cosmos/Extensions/CosmosDbContextOptionsExtensions.cs

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
using Microsoft.EntityFrameworkCore.Infrastructure;
88
using Microsoft.EntityFrameworkCore.Utilities;
99

10-
#nullable enable
11-
1210
// ReSharper disable once CheckNamespace
1311
namespace Microsoft.EntityFrameworkCore
1412
{

Diff for: src/EFCore.Cosmos/Extensions/CosmosEntityTypeBuilderExtensions.cs

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
using Microsoft.EntityFrameworkCore.Metadata.Builders;
1111
using Microsoft.EntityFrameworkCore.Utilities;
1212

13-
#nullable enable
14-
1513
// ReSharper disable once CheckNamespace
1614
namespace Microsoft.EntityFrameworkCore
1715
{

Diff for: src/EFCore.Cosmos/Extensions/CosmosEntityTypeExtensions.cs

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
using Microsoft.EntityFrameworkCore.Metadata;
77
using Microsoft.EntityFrameworkCore.Utilities;
88

9-
#nullable enable
10-
119
// ReSharper disable once CheckNamespace
1210
namespace Microsoft.EntityFrameworkCore
1311
{

Diff for: src/EFCore.Cosmos/Extensions/CosmosModelBuilderExtensions.cs

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
using Microsoft.EntityFrameworkCore.Metadata.Builders;
77
using Microsoft.EntityFrameworkCore.Utilities;
88

9-
#nullable enable
10-
119
// ReSharper disable once CheckNamespace
1210
namespace Microsoft.EntityFrameworkCore
1311
{

Diff for: src/EFCore.Cosmos/Extensions/CosmosModelExtensions.cs

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
using Microsoft.EntityFrameworkCore.Metadata;
77
using Microsoft.EntityFrameworkCore.Utilities;
88

9-
#nullable enable
10-
119
// ReSharper disable once CheckNamespace
1210
namespace Microsoft.EntityFrameworkCore
1311
{

Diff for: src/EFCore.Cosmos/Extensions/CosmosPropertyBuilderExtensions.cs

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
using Microsoft.EntityFrameworkCore.Metadata.Builders;
77
using Microsoft.EntityFrameworkCore.Utilities;
88

9-
#nullable enable
10-
119
// ReSharper disable once CheckNamespace
1210
namespace Microsoft.EntityFrameworkCore
1311
{

Diff for: src/EFCore.Cosmos/Extensions/CosmosPropertyExtensions.cs

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
using Microsoft.EntityFrameworkCore.Cosmos.Metadata.Internal;
77
using Microsoft.EntityFrameworkCore.Metadata;
88

9-
#nullable enable
10-
119
// ReSharper disable once CheckNamespace
1210
namespace Microsoft.EntityFrameworkCore
1311
{

Diff for: src/EFCore.Cosmos/Extensions/CosmosQueryableExtensions.cs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
using Microsoft.EntityFrameworkCore.Query.Internal;
1111
using Microsoft.EntityFrameworkCore.Utilities;
1212

13-
#nullable enable
1413
// ReSharper disable once CheckNamespace
1514
namespace Microsoft.EntityFrameworkCore
1615
{

Diff for: src/EFCore.Cosmos/Extensions/CosmosServiceCollectionExtensions.cs

-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
using Microsoft.EntityFrameworkCore.Utilities;
1919
using Microsoft.EntityFrameworkCore.ValueGeneration;
2020

21-
#nullable enable
22-
2321
// ReSharper disable once CheckNamespace
2422
namespace Microsoft.Extensions.DependencyInjection
2523
{

Diff for: src/EFCore.Cosmos/Extensions/Internal/CosmosExpressionExtensions.cs

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
using JetBrains.Annotations;
66
using Microsoft.EntityFrameworkCore.Cosmos.Query.Internal;
77

8-
#nullable enable
9-
108
// ReSharper disable once CheckNamespace
119
namespace Microsoft.EntityFrameworkCore.Internal
1210
{

Diff for: src/EFCore.Cosmos/Infrastructure/CosmosDbContextOptionsBuilder.cs

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
using Microsoft.EntityFrameworkCore.Storage;
1111
using Microsoft.EntityFrameworkCore.Utilities;
1212

13-
#nullable enable
14-
1513
namespace Microsoft.EntityFrameworkCore.Infrastructure
1614
{
1715
/// <summary>

Diff for: src/EFCore.Cosmos/Infrastructure/Internal/CosmosDbOptionExtension.cs

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
using Microsoft.EntityFrameworkCore.Utilities;
1515
using Microsoft.Extensions.DependencyInjection;
1616

17-
#nullable enable
18-
1917
namespace Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.Internal
2018
{
2119
/// <summary>

Diff for: src/EFCore.Cosmos/Infrastructure/Internal/CosmosModelValidator.cs

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
using Microsoft.EntityFrameworkCore.Metadata.Conventions;
1414
using Microsoft.EntityFrameworkCore.Utilities;
1515

16-
#nullable enable
17-
1816
namespace Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.Internal
1917
{
2018
/// <summary>

Diff for: src/EFCore.Cosmos/Infrastructure/Internal/CosmosSingletonOptions.cs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
using Microsoft.EntityFrameworkCore.Infrastructure;
99
using Microsoft.Extensions.DependencyInjection;
1010

11-
#nullable enable
12-
1311
namespace Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.Internal
1412
{
1513
/// <summary>

Diff for: src/EFCore.Cosmos/Infrastructure/Internal/ICosmosSingletonOptions.cs

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
using Microsoft.EntityFrameworkCore.Infrastructure;
88
using Microsoft.Extensions.DependencyInjection;
99

10-
#nullable enable
11-
1210
namespace Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.Internal
1311
{
1412
/// <summary>

Diff for: src/EFCore.Cosmos/Metadata/Conventions/ContextContainerConvention.cs

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
using Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure;
77
using Microsoft.EntityFrameworkCore.Utilities;
88

9-
#nullable enable
10-
119
namespace Microsoft.EntityFrameworkCore.Metadata.Conventions
1210
{
1311
/// <summary>

Diff for: src/EFCore.Cosmos/Metadata/Conventions/CosmosDiscriminatorConvention.cs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
using Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure;
99
using Microsoft.EntityFrameworkCore.Utilities;
1010

11-
#nullable enable
12-
1311
namespace Microsoft.EntityFrameworkCore.Metadata.Conventions
1412
{
1513
/// <summary>

Diff for: src/EFCore.Cosmos/Metadata/Conventions/CosmosKeyDiscoveryConvention.cs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
using Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure;
99
using Microsoft.EntityFrameworkCore.Utilities;
1010

11-
#nullable enable
12-
1311
namespace Microsoft.EntityFrameworkCore.Metadata.Conventions
1412
{
1513
/// <summary>

Diff for: src/EFCore.Cosmos/Metadata/Conventions/ETagPropertyConvention.cs

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
using Microsoft.EntityFrameworkCore.Metadata.Builders;
55
using Microsoft.EntityFrameworkCore.Metadata.Conventions;
66

7-
#nullable enable
8-
97
namespace Microsoft.EntityFrameworkCore.Cosmos.Metadata.Conventions
108
{
119
/// <summary>

Diff for: src/EFCore.Cosmos/Metadata/Conventions/Internal/CosmosConventionSetBuilder.cs

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
using Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure;
88
using Microsoft.Extensions.DependencyInjection;
99

10-
#nullable enable
11-
1210
namespace Microsoft.EntityFrameworkCore.Cosmos.Metadata.Conventions.Internal
1311
{
1412
/// <summary>

Diff for: src/EFCore.Cosmos/Metadata/Conventions/StoreKeyConvention.cs

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
using Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure;
1212
using Newtonsoft.Json.Linq;
1313

14-
#nullable enable
15-
1614
// ReSharper disable once CheckNamespace
1715
namespace Microsoft.EntityFrameworkCore.Metadata.Conventions
1816
{

Diff for: src/EFCore.Cosmos/Metadata/Internal/CosmosAnnotationNames.cs

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

4-
#nullable enable
5-
64
namespace Microsoft.EntityFrameworkCore.Cosmos.Metadata.Internal
75
{
86
/// <summary>

Diff for: src/EFCore.Cosmos/Metadata/Internal/CosmosEntityTypeExtensions.cs

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
using JetBrains.Annotations;
55
using Microsoft.EntityFrameworkCore.Metadata;
66

7-
#nullable enable
8-
97
namespace Microsoft.EntityFrameworkCore.Cosmos.Metadata.Internal
108
{
119
/// <summary>

Diff for: src/EFCore.Cosmos/Metadata/Internal/CosmosNavigationExtensions.cs

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
using JetBrains.Annotations;
55
using Microsoft.EntityFrameworkCore.Metadata;
66

7-
#nullable enable
8-
97
namespace Microsoft.EntityFrameworkCore.Cosmos.Metadata.Internal
108
{
119
/// <summary>

Diff for: src/EFCore.Cosmos/Metadata/Internal/CosmosPropertyExtensions.cs

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
using Microsoft.EntityFrameworkCore.Metadata;
66
using Microsoft.EntityFrameworkCore.Utilities;
77

8-
#nullable enable
9-
108
namespace Microsoft.EntityFrameworkCore.Cosmos.Metadata.Internal
119
{
1210
/// <summary>

Diff for: src/EFCore.Cosmos/Query/Internal/ContainsTranslator.cs

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
using JetBrains.Annotations;
77
using Microsoft.EntityFrameworkCore.Diagnostics;
88

9-
#nullable enable
10-
119
namespace Microsoft.EntityFrameworkCore.Cosmos.Query.Internal
1210
{
1311
/// <summary>

Diff for: src/EFCore.Cosmos/Query/Internal/CosmosMemberTranslatorProvider.cs

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
using Microsoft.EntityFrameworkCore.Diagnostics;
1010
using Microsoft.EntityFrameworkCore.Utilities;
1111

12-
#nullable enable
13-
1412
namespace Microsoft.EntityFrameworkCore.Cosmos.Query.Internal
1513
{
1614
/// <summary>

Diff for: src/EFCore.Cosmos/Query/Internal/CosmosMethodCallTranslatorProvider.cs

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
using Microsoft.EntityFrameworkCore.Metadata;
1010
using Microsoft.EntityFrameworkCore.Utilities;
1111

12-
#nullable enable
13-
1412
namespace Microsoft.EntityFrameworkCore.Cosmos.Query.Internal
1513
{
1614
/// <summary>

Diff for: src/EFCore.Cosmos/Query/Internal/CosmosQueryCompilationContext.cs

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
using JetBrains.Annotations;
55
using Microsoft.EntityFrameworkCore.Query;
66

7-
#nullable enable
8-
97
namespace Microsoft.EntityFrameworkCore.Cosmos.Query.Internal
108
{
119
/// <summary>

Diff for: src/EFCore.Cosmos/Query/Internal/CosmosQueryCompilationContextFactory.cs

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
using Microsoft.EntityFrameworkCore.Utilities;
77
using Microsoft.Extensions.DependencyInjection;
88

9-
#nullable enable
10-
119
namespace Microsoft.EntityFrameworkCore.Cosmos.Query.Internal
1210
{
1311
/// <summary>

Diff for: src/EFCore.Cosmos/Query/Internal/CosmosQueryContext.cs

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
using Microsoft.EntityFrameworkCore.Query;
77
using Microsoft.EntityFrameworkCore.Utilities;
88

9-
#nullable enable
10-
119
namespace Microsoft.EntityFrameworkCore.Cosmos.Query.Internal
1210
{
1311
/// <summary>

Diff for: src/EFCore.Cosmos/Query/Internal/CosmosQueryContextFactory.cs

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
using Microsoft.EntityFrameworkCore.Query;
77
using Microsoft.EntityFrameworkCore.Utilities;
88

9-
#nullable enable
10-
119
namespace Microsoft.EntityFrameworkCore.Cosmos.Query.Internal
1210
{
1311
/// <summary>

Diff for: src/EFCore.Cosmos/Query/Internal/CosmosQueryMetadataExtractingExpressionVisitor.cs

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
using JetBrains.Annotations;
66
using Microsoft.EntityFrameworkCore.Utilities;
77

8-
#nullable enable
9-
108
namespace Microsoft.EntityFrameworkCore.Cosmos.Query.Internal
119
{
1210
/// <summary>

Diff for: src/EFCore.Cosmos/Query/Internal/CosmosQueryTranslationPostprocessor.cs

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
using Microsoft.EntityFrameworkCore.Query;
77
using Microsoft.EntityFrameworkCore.Utilities;
88

9-
#nullable enable
10-
119
namespace Microsoft.EntityFrameworkCore.Cosmos.Query.Internal
1210
{
1311
/// <summary>

0 commit comments

Comments
 (0)