diff --git a/src/Components/Server/src/Circuits/CircuitIdFactory.cs b/src/Components/Server/src/Circuits/CircuitIdFactory.cs index 7250ee8116..61ded8c441 100644 --- a/src/Components/Server/src/Circuits/CircuitIdFactory.cs +++ b/src/Components/Server/src/Circuits/CircuitIdFactory.cs @@ -48,7 +48,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits return new CircuitId(Base64UrlTextEncoder.Encode(secret), Base64UrlTextEncoder.Encode(id)); } - public bool TryParseCircuitId(string text, out CircuitId circuitId) + public bool TryParseCircuitId(string? text, out CircuitId circuitId) { if (text is null) { diff --git a/src/Components/Server/src/Circuits/RemoteRenderer.cs b/src/Components/Server/src/Circuits/RemoteRenderer.cs index 0d9f862da2..59f93f6526 100644 --- a/src/Components/Server/src/Circuits/RemoteRenderer.cs +++ b/src/Components/Server/src/Circuits/RemoteRenderer.cs @@ -27,7 +27,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits /// /// Notifies when a rendering exception occurred. /// - public event EventHandler UnhandledException; + public event EventHandler? UnhandledException; /// /// Creates a new . @@ -171,7 +171,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits pendingRender = new UnacknowledgedRenderBatch( renderId, arrayBuilder, - new TaskCompletionSource(), + new TaskCompletionSource(), ValueStopwatch.StartNew()); // Buffer the rendered batches no matter what. We'll send it down immediately when the client @@ -234,7 +234,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits // disposed. } - public Task OnRenderCompletedAsync(long incomingBatchId, string errorMessageOrNull) + public Task OnRenderCompletedAsync(long incomingBatchId, string? errorMessageOrNull) { if (_disposing) { @@ -308,7 +308,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits } } - private void ProcessPendingBatch(string errorMessageOrNull, UnacknowledgedRenderBatch entry) + private void ProcessPendingBatch(string? errorMessageOrNull, UnacknowledgedRenderBatch entry) { var elapsedTime = entry.ValueStopwatch.GetElapsedTime(); if (errorMessageOrNull == null) @@ -324,11 +324,11 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits CompleteRender(entry.CompletionSource, errorMessageOrNull); } - private void CompleteRender(TaskCompletionSource pendingRenderInfo, string errorMessageOrNull) + private void CompleteRender(TaskCompletionSource pendingRenderInfo, string? errorMessageOrNull) { if (errorMessageOrNull == null) { - pendingRenderInfo.TrySetResult(null); + pendingRenderInfo.TrySetResult(); } else { @@ -338,7 +338,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits internal readonly struct UnacknowledgedRenderBatch { - public UnacknowledgedRenderBatch(long batchId, ArrayBuilder data, TaskCompletionSource completionSource, ValueStopwatch valueStopwatch) + public UnacknowledgedRenderBatch(long batchId, ArrayBuilder data, TaskCompletionSource completionSource, ValueStopwatch valueStopwatch) { BatchId = batchId; Data = data; @@ -348,7 +348,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits public long BatchId { get; } public ArrayBuilder Data { get; } - public TaskCompletionSource CompletionSource { get; } + public TaskCompletionSource CompletionSource { get; } public ValueStopwatch ValueStopwatch { get; } } diff --git a/src/Components/Shared/src/ArrayBuilder.cs b/src/Components/Shared/src/ArrayBuilder.cs index afb7b01987..206c741538 100644 --- a/src/Components/Shared/src/ArrayBuilder.cs +++ b/src/Components/Shared/src/ArrayBuilder.cs @@ -18,7 +18,7 @@ namespace Microsoft.AspNetCore.Components.RenderTree { /// /// Implements a list that uses an array of objects to store the elements. - /// + /// /// This differs from a in that /// it not only grows as required but also shrinks if cleared with significant /// excess capacity. This makes it useful for component rendering, because diff --git a/src/DefaultBuilder/src/WebHost.cs b/src/DefaultBuilder/src/WebHost.cs index ff79107d32..45617c693f 100644 --- a/src/DefaultBuilder/src/WebHost.cs +++ b/src/DefaultBuilder/src/WebHost.cs @@ -31,7 +31,7 @@ namespace Microsoft.AspNetCore /// A delegate that handles requests to the application. /// A started that hosts the application. public static IWebHost Start(RequestDelegate app) => - Start(url: null, app: app); + Start(url: null!, app: app); /// /// Initializes and starts a new with pre-configured defaults. @@ -40,7 +40,7 @@ namespace Microsoft.AspNetCore /// The URL the hosted application will listen on. /// A delegate that handles requests to the application. /// A started that hosts the application. - public static IWebHost Start(string? url, RequestDelegate app) + public static IWebHost Start(string url, RequestDelegate app) { var startupAssemblyName = app.GetMethodInfo().DeclaringType!.GetTypeInfo().Assembly.GetName().Name; return StartWith(url: url, configureServices: null, app: appBuilder => appBuilder.Run(app), applicationName: startupAssemblyName); @@ -53,7 +53,7 @@ namespace Microsoft.AspNetCore /// A delegate that configures the router for handling requests to the application. /// A started that hosts the application. public static IWebHost Start(Action routeBuilder) => - Start(url: null, routeBuilder: routeBuilder); + Start(url: null!, routeBuilder: routeBuilder); /// /// Initializes and starts a new with pre-configured defaults. @@ -62,7 +62,7 @@ namespace Microsoft.AspNetCore /// The URL the hosted application will listen on. /// A delegate that configures the router for handling requests to the application. /// A started that hosts the application. - public static IWebHost Start(string? url, Action routeBuilder) + public static IWebHost Start(string url, Action routeBuilder) { var startupAssemblyName = routeBuilder.GetMethodInfo().DeclaringType!.GetTypeInfo().Assembly.GetName().Name; return StartWith(url, services => services.AddRouting(), appBuilder => appBuilder.UseRouter(routeBuilder), applicationName: startupAssemblyName); @@ -75,7 +75,7 @@ namespace Microsoft.AspNetCore /// The delegate that configures the . /// A started that hosts the application. public static IWebHost StartWith(Action app) => - StartWith(url: null, app: app); + StartWith(url: null!, app: app); /// /// Initializes and starts a new with pre-configured defaults. @@ -84,7 +84,7 @@ namespace Microsoft.AspNetCore /// The URL the hosted application will listen on. /// The delegate that configures the . /// A started that hosts the application. - public static IWebHost StartWith(string? url, Action app) => + public static IWebHost StartWith(string url, Action app) => StartWith(url: url, configureServices: null, app: app, applicationName: null); private static IWebHost StartWith(string? url, Action? configureServices, Action app, string? applicationName) @@ -132,7 +132,7 @@ namespace Microsoft.AspNetCore /// /// The initialized . public static IWebHostBuilder CreateDefaultBuilder() => - CreateDefaultBuilder(args: null); + CreateDefaultBuilder(args: null!); /// /// Initializes a new instance of the class with pre-configured defaults. @@ -153,7 +153,7 @@ namespace Microsoft.AspNetCore /// /// The command line args. /// The initialized . - public static IWebHostBuilder CreateDefaultBuilder(string[]? args) + public static IWebHostBuilder CreateDefaultBuilder(string[] args) { var builder = new WebHostBuilder(); diff --git a/src/Hosting/Server.Abstractions/src/IServerIntegratedAuth.cs b/src/Hosting/Server.Abstractions/src/IServerIntegratedAuth.cs index 218b461b0a..d099656ac4 100644 --- a/src/Hosting/Server.Abstractions/src/IServerIntegratedAuth.cs +++ b/src/Hosting/Server.Abstractions/src/IServerIntegratedAuth.cs @@ -16,6 +16,6 @@ namespace Microsoft.AspNetCore.Hosting.Server /// /// The name of the authentication scheme for the server authentication handler. /// - string? AuthenticationScheme { get; } + string AuthenticationScheme { get; } } } diff --git a/src/Hosting/Server.Abstractions/src/ServerIntegratedAuth.cs b/src/Hosting/Server.Abstractions/src/ServerIntegratedAuth.cs index 0ab301cfaf..547dff5c95 100644 --- a/src/Hosting/Server.Abstractions/src/ServerIntegratedAuth.cs +++ b/src/Hosting/Server.Abstractions/src/ServerIntegratedAuth.cs @@ -16,6 +16,6 @@ namespace Microsoft.AspNetCore.Hosting.Server /// /// The name of the authentication scheme for the server authentication handler. /// - public string? AuthenticationScheme { get; set; } + public string AuthenticationScheme { get; set; } = default!; } } diff --git a/src/Http/Authentication.Abstractions/src/AuthenticateResult.cs b/src/Http/Authentication.Abstractions/src/AuthenticateResult.cs index f10b5b9392..5bb29e8589 100644 --- a/src/Http/Authentication.Abstractions/src/AuthenticateResult.cs +++ b/src/Http/Authentication.Abstractions/src/AuthenticateResult.cs @@ -98,7 +98,7 @@ namespace Microsoft.AspNetCore.Authentication /// /// The failure exception. /// The result. - public static AuthenticateResult Fail(Exception? failure) + public static AuthenticateResult Fail(Exception failure) { return new AuthenticateResult() { Failure = failure }; } @@ -109,7 +109,7 @@ namespace Microsoft.AspNetCore.Authentication /// The failure exception. /// Additional state values for the authentication session. /// The result. - public static AuthenticateResult Fail(Exception? failure, AuthenticationProperties? properties) + public static AuthenticateResult Fail(Exception failure, AuthenticationProperties? properties) { return new AuthenticateResult() { Failure = failure, Properties = properties }; } @@ -119,7 +119,7 @@ namespace Microsoft.AspNetCore.Authentication /// /// The failure message. /// The result. - public static AuthenticateResult Fail(string? failureMessage) + public static AuthenticateResult Fail(string failureMessage) => Fail(new Exception(failureMessage)); /// @@ -128,7 +128,7 @@ namespace Microsoft.AspNetCore.Authentication /// The failure message. /// Additional state values for the authentication session. /// The result. - public static AuthenticateResult Fail(string? failureMessage, AuthenticationProperties? properties) + public static AuthenticateResult Fail(string failureMessage, AuthenticationProperties? properties) => Fail(new Exception(failureMessage), properties); } } diff --git a/src/Http/Authentication.Abstractions/src/AuthenticationToken.cs b/src/Http/Authentication.Abstractions/src/AuthenticationToken.cs index 88c5d337ea..f03a1c965f 100644 --- a/src/Http/Authentication.Abstractions/src/AuthenticationToken.cs +++ b/src/Http/Authentication.Abstractions/src/AuthenticationToken.cs @@ -12,11 +12,11 @@ namespace Microsoft.AspNetCore.Authentication /// /// Name. /// - public string? Name { get; set; } + public string Name { get; set; } = default!; /// /// Value. /// - public string? Value { get; set; } + public string Value { get; set; } = default!; } } diff --git a/src/JSInterop/Microsoft.JSInterop/src/IJSInProcessRuntime.cs b/src/JSInterop/Microsoft.JSInterop/src/IJSInProcessRuntime.cs index 6da8d7f3a7..95b84bc2dc 100644 --- a/src/JSInterop/Microsoft.JSInterop/src/IJSInProcessRuntime.cs +++ b/src/JSInterop/Microsoft.JSInterop/src/IJSInProcessRuntime.cs @@ -15,6 +15,6 @@ namespace Microsoft.JSInterop /// An identifier for the function to invoke. For example, the value "someScope.someFunction" will invoke the function window.someScope.someFunction. /// JSON-serializable arguments. /// An instance of obtained by JSON-deserializing the return value. - T Invoke(string identifier, params object[] args); + T Invoke(string identifier, params object?[] args); } } diff --git a/src/JSInterop/Microsoft.JSInterop/src/JSInProcessRuntime.cs b/src/JSInterop/Microsoft.JSInterop/src/JSInProcessRuntime.cs index 5125cbd701..82329a3b79 100644 --- a/src/JSInterop/Microsoft.JSInterop/src/JSInProcessRuntime.cs +++ b/src/JSInterop/Microsoft.JSInterop/src/JSInProcessRuntime.cs @@ -19,7 +19,7 @@ namespace Microsoft.JSInterop /// JSON-serializable arguments. /// An instance of obtained by JSON-deserializing the return value. [return: MaybeNull] - public TValue Invoke(string identifier, params object[] args) + public TValue Invoke(string identifier, params object?[] args) { var resultJson = InvokeJS(identifier, JsonSerializer.Serialize(args, JsonSerializerOptions)); if (resultJson is null) diff --git a/src/JSInterop/Microsoft.JSInterop/src/JSInProcessRuntimeExtensions.cs b/src/JSInterop/Microsoft.JSInterop/src/JSInProcessRuntimeExtensions.cs index 5a040d9b78..fa55d37c1b 100644 --- a/src/JSInterop/Microsoft.JSInterop/src/JSInProcessRuntimeExtensions.cs +++ b/src/JSInterop/Microsoft.JSInterop/src/JSInProcessRuntimeExtensions.cs @@ -16,7 +16,7 @@ namespace Microsoft.JSInterop /// The . /// An identifier for the function to invoke. For example, the value "someScope.someFunction" will invoke the function window.someScope.someFunction. /// JSON-serializable arguments. - public static void InvokeVoid(this IJSInProcessRuntime jsRuntime, string identifier, params object[] args) + public static void InvokeVoid(this IJSInProcessRuntime jsRuntime, string identifier, params object?[] args) { if (jsRuntime == null) { diff --git a/src/Mvc/Mvc.Abstractions/src/IUrlHelper.cs b/src/Mvc/Mvc.Abstractions/src/IUrlHelper.cs index 8a0a75db9e..c18009e626 100644 --- a/src/Mvc/Mvc.Abstractions/src/IUrlHelper.cs +++ b/src/Mvc/Mvc.Abstractions/src/IUrlHelper.cs @@ -32,7 +32,7 @@ namespace Microsoft.AspNetCore.Mvc /// your deployment environment. /// /// - string Action(UrlActionContext actionContext); + string? Action(UrlActionContext actionContext); /// /// Converts a virtual (relative, starting with ~/) path to an application absolute path. @@ -43,7 +43,7 @@ namespace Microsoft.AspNetCore.Mvc /// /// The virtual path of the content. /// The application absolute path. - string Content(string contentPath); + string? Content(string? contentPath); /// /// Returns a value that indicates whether the URL is local. A URL is considered local if it does not have a @@ -68,7 +68,7 @@ namespace Microsoft.AspNetCore.Mvc /// /// /// - bool IsLocalUrl(string url); + bool IsLocalUrl(string? url); /// /// Generates a URL with an absolute path, which contains the route name, route values, protocol to use, host @@ -86,7 +86,7 @@ namespace Microsoft.AspNetCore.Mvc /// your deployment environment. /// /// - string RouteUrl(UrlRouteContext routeContext); + string? RouteUrl(UrlRouteContext routeContext); /// /// Generates an absolute URL for the specified and route @@ -99,11 +99,11 @@ namespace Microsoft.AspNetCore.Mvc /// /// /// This method uses the value of to populate the host section of the generated URI. - /// Relying on the value of the current request can allow untrusted input to influence the resulting URI unless - /// the Host header has been validated. See the deployment documentation for instructions on how to properly + /// Relying on the value of the current request can allow untrusted input to influence the resulting URI unless + /// the Host header has been validated. See the deployment documentation for instructions on how to properly /// validate the Host header in your deployment environment. /// /// - string Link(string routeName, object values); + string? Link(string? routeName, object? values); } } diff --git a/src/Mvc/Mvc.Abstractions/src/ModelBinding/IModelBinderProvider.cs b/src/Mvc/Mvc.Abstractions/src/ModelBinding/IModelBinderProvider.cs index 397fa7e637..a2807b3598 100644 --- a/src/Mvc/Mvc.Abstractions/src/ModelBinding/IModelBinderProvider.cs +++ b/src/Mvc/Mvc.Abstractions/src/ModelBinding/IModelBinderProvider.cs @@ -14,6 +14,6 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding /// /// The . /// An . - IModelBinder GetBinder(ModelBinderProviderContext context); + IModelBinder? GetBinder(ModelBinderProviderContext context); } } \ No newline at end of file diff --git a/src/Mvc/Mvc.Abstractions/src/ModelBinding/ModelBindingResult.cs b/src/Mvc/Mvc.Abstractions/src/ModelBinding/ModelBindingResult.cs index 3ab9c0ba4f..b29736cd57 100644 --- a/src/Mvc/Mvc.Abstractions/src/ModelBinding/ModelBindingResult.cs +++ b/src/Mvc/Mvc.Abstractions/src/ModelBinding/ModelBindingResult.cs @@ -24,7 +24,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding /// /// The model value. May be null. /// A representing a successful model bind. - public static ModelBindingResult Success(object model) + public static ModelBindingResult Success(object? model) { return new ModelBindingResult(model, isModelSet: true); } diff --git a/src/Mvc/Mvc.Abstractions/src/PublicAPI.Unshipped.txt b/src/Mvc/Mvc.Abstractions/src/PublicAPI.Unshipped.txt index af32a8728d..8d5fe4b5b5 100644 --- a/src/Mvc/Mvc.Abstractions/src/PublicAPI.Unshipped.txt +++ b/src/Mvc/Mvc.Abstractions/src/PublicAPI.Unshipped.txt @@ -290,12 +290,12 @@ Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterWriteContext.OutputFormatterW Microsoft.AspNetCore.Mvc.IActionResult Microsoft.AspNetCore.Mvc.IActionResult.ExecuteResultAsync(Microsoft.AspNetCore.Mvc.ActionContext! context) -> System.Threading.Tasks.Task! Microsoft.AspNetCore.Mvc.IUrlHelper -Microsoft.AspNetCore.Mvc.IUrlHelper.Action(Microsoft.AspNetCore.Mvc.Routing.UrlActionContext! actionContext) -> string! +Microsoft.AspNetCore.Mvc.IUrlHelper.Action(Microsoft.AspNetCore.Mvc.Routing.UrlActionContext! actionContext) -> string? Microsoft.AspNetCore.Mvc.IUrlHelper.ActionContext.get -> Microsoft.AspNetCore.Mvc.ActionContext! -Microsoft.AspNetCore.Mvc.IUrlHelper.Content(string! contentPath) -> string! -Microsoft.AspNetCore.Mvc.IUrlHelper.IsLocalUrl(string! url) -> bool -Microsoft.AspNetCore.Mvc.IUrlHelper.Link(string! routeName, object! values) -> string! -Microsoft.AspNetCore.Mvc.IUrlHelper.RouteUrl(Microsoft.AspNetCore.Mvc.Routing.UrlRouteContext! routeContext) -> string! +Microsoft.AspNetCore.Mvc.IUrlHelper.Content(string? contentPath) -> string? +Microsoft.AspNetCore.Mvc.IUrlHelper.IsLocalUrl(string? url) -> bool +Microsoft.AspNetCore.Mvc.IUrlHelper.Link(string? routeName, object? values) -> string? +Microsoft.AspNetCore.Mvc.IUrlHelper.RouteUrl(Microsoft.AspNetCore.Mvc.Routing.UrlRouteContext! routeContext) -> string? Microsoft.AspNetCore.Mvc.ModelBinding.BindingInfo Microsoft.AspNetCore.Mvc.ModelBinding.BindingInfo.BinderModelName.get -> string? Microsoft.AspNetCore.Mvc.ModelBinding.BindingInfo.BinderModelName.set -> void @@ -337,7 +337,7 @@ Microsoft.AspNetCore.Mvc.ModelBinding.IBindingSourceMetadata.BindingSource.get - Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder.BindModelAsync(Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext! bindingContext) -> System.Threading.Tasks.Task! Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinderProvider -Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinderProvider.GetBinder(Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderProviderContext! context) -> Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder! +Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinderProvider.GetBinder(Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderProviderContext! context) -> Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder? Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider.GetMetadataForProperties(System.Type! modelType) -> System.Collections.Generic.IEnumerable! Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider.GetMetadataForType(System.Type! modelType) -> Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata! @@ -742,7 +742,7 @@ static Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.ModelMetadataIdentity.ForP static Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.ModelMetadataIdentity.ForProperty(System.Type! modelType, string! name, System.Type! containerType) -> Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.ModelMetadataIdentity static Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.ModelMetadataIdentity.ForType(System.Type! modelType) -> Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.ModelMetadataIdentity static Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult.Failed() -> Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult -static Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult.Success(object! model) -> Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult +static Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult.Success(object? model) -> Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult static Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult.operator !=(Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult x, Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult y) -> bool static Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult.operator ==(Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult x, Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult y) -> bool static Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary.StartsWithPrefix(string! prefix, string! key) -> bool diff --git a/src/Security/Authentication/Cookies/src/CookieExtensions.cs b/src/Security/Authentication/Cookies/src/CookieExtensions.cs index 7787ad8094..252bfe988c 100644 --- a/src/Security/Authentication/Cookies/src/CookieExtensions.cs +++ b/src/Security/Authentication/Cookies/src/CookieExtensions.cs @@ -15,15 +15,15 @@ namespace Microsoft.Extensions.DependencyInjection => builder.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme); public static AuthenticationBuilder AddCookie(this AuthenticationBuilder builder, string authenticationScheme) - => builder.AddCookie(authenticationScheme, configureOptions: null); + => builder.AddCookie(authenticationScheme, configureOptions: null!); - public static AuthenticationBuilder AddCookie(this AuthenticationBuilder builder, Action? configureOptions) + public static AuthenticationBuilder AddCookie(this AuthenticationBuilder builder, Action configureOptions) => builder.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, configureOptions); - public static AuthenticationBuilder AddCookie(this AuthenticationBuilder builder, string authenticationScheme, Action? configureOptions) + public static AuthenticationBuilder AddCookie(this AuthenticationBuilder builder, string authenticationScheme, Action configureOptions) => builder.AddCookie(authenticationScheme, displayName: null, configureOptions: configureOptions); - public static AuthenticationBuilder AddCookie(this AuthenticationBuilder builder, string authenticationScheme, string? displayName, Action? configureOptions) + public static AuthenticationBuilder AddCookie(this AuthenticationBuilder builder, string authenticationScheme, string? displayName, Action configureOptions) { builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton, PostConfigureCookieAuthenticationOptions>()); builder.Services.AddOptions(authenticationScheme).Validate(o => o.Cookie.Expiration == null, "Cookie.Expiration is ignored, use ExpireTimeSpan instead.");