Annotate webencoders with nullable (#22927)

This commit is contained in:
Pranav K 2020-06-15 16:11:20 -07:00 committed by GitHub
parent 416c78bc9e
commit c93b61156d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 3 deletions

View File

@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;$(DefaultNetCoreTargetFramework)</TargetFrameworks>
<TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">$(DefaultNetCoreTargetFramework)</TargetFrameworks>
<Nullable>annotations</Nullable>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<Compile Include="Microsoft.Extensions.WebEncoders.netstandard2.0.cs" />

View File

@ -14,7 +14,7 @@ namespace Microsoft.Extensions.WebEncoders
public sealed partial class WebEncoderOptions
{
public WebEncoderOptions() { }
public System.Text.Encodings.Web.TextEncoderSettings TextEncoderSettings { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
public System.Text.Encodings.Web.TextEncoderSettings? TextEncoderSettings { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
}
}
namespace Microsoft.Extensions.WebEncoders.Testing

View File

@ -14,7 +14,7 @@ namespace Microsoft.Extensions.WebEncoders
public sealed partial class WebEncoderOptions
{
public WebEncoderOptions() { }
public System.Text.Encodings.Web.TextEncoderSettings TextEncoderSettings { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
public System.Text.Encodings.Web.TextEncoderSettings? TextEncoderSettings { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
}
}
namespace Microsoft.Extensions.WebEncoders.Testing

View File

@ -9,6 +9,7 @@
<PackageTags>aspnetcore</PackageTags>
<IsPackable>true</IsPackable>
<IsAspNetCoreApp>true</IsAspNetCoreApp>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>

View File

@ -16,6 +16,6 @@ namespace Microsoft.Extensions.WebEncoders
/// <remarks>
/// If this property is null, then the encoders will use their default allow lists.
/// </remarks>
public TextEncoderSettings TextEncoderSettings { get; set; }
public TextEncoderSettings? TextEncoderSettings { get; set; }
}
}

View File

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFrameworks>$(DefaultNetCoreTargetFramework);net472</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>