diff --git a/src/JSInterop/Microsoft.JSInterop/src/IJSInProcessRuntime.cs b/src/JSInterop/Microsoft.JSInterop/src/IJSInProcessRuntime.cs index 6da8d7f3a7..d1ccd639db 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/IJSRuntime.cs b/src/JSInterop/Microsoft.JSInterop/src/IJSRuntime.cs index 26a7be400f..914811d8b4 100644 --- a/src/JSInterop/Microsoft.JSInterop/src/IJSRuntime.cs +++ b/src/JSInterop/Microsoft.JSInterop/src/IJSRuntime.cs @@ -22,7 +22,7 @@ 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. - ValueTask InvokeAsync(string identifier, object[] args); + ValueTask InvokeAsync(string identifier, object?[]? args); /// /// Invokes the specified JavaScript function asynchronously. @@ -35,6 +35,6 @@ namespace Microsoft.JSInterop /// /// JSON-serializable arguments. /// An instance of obtained by JSON-deserializing the return value. - ValueTask InvokeAsync(string identifier, CancellationToken cancellationToken, object[] args); + ValueTask InvokeAsync(string identifier, CancellationToken cancellationToken, object?[]? args); } } diff --git a/src/JSInterop/Microsoft.JSInterop/src/Infrastructure/DotNetDispatcher.cs b/src/JSInterop/Microsoft.JSInterop/src/Infrastructure/DotNetDispatcher.cs index 30c1910143..1f8b5c9b5f 100644 --- a/src/JSInterop/Microsoft.JSInterop/src/Infrastructure/DotNetDispatcher.cs +++ b/src/JSInterop/Microsoft.JSInterop/src/Infrastructure/DotNetDispatcher.cs @@ -136,7 +136,7 @@ namespace Microsoft.JSInterop.Infrastructure Type[] parameterTypes; if (objectReference is null) { - assemblyKey = new AssemblyKey(assemblyName); + assemblyKey = new AssemblyKey(assemblyName!); (methodInfo, parameterTypes) = GetCachedMethodInfo(assemblyKey, methodIdentifier); } else diff --git a/src/JSInterop/Microsoft.JSInterop/src/Infrastructure/DotNetInvocationInfo.cs b/src/JSInterop/Microsoft.JSInterop/src/Infrastructure/DotNetInvocationInfo.cs index 942fc34da0..bbec14337e 100644 --- a/src/JSInterop/Microsoft.JSInterop/src/Infrastructure/DotNetInvocationInfo.cs +++ b/src/JSInterop/Microsoft.JSInterop/src/Infrastructure/DotNetInvocationInfo.cs @@ -15,7 +15,7 @@ namespace Microsoft.JSInterop.Infrastructure /// The identifier of the method to be invoked. /// The object identifier for instance method calls. /// The call identifier. - public DotNetInvocationInfo(string assemblyName, string methodIdentifier, long dotNetObjectId, string callId) + public DotNetInvocationInfo(string? assemblyName, string methodIdentifier, long dotNetObjectId, string? callId) { CallId = callId; AssemblyName = assemblyName; @@ -27,7 +27,7 @@ namespace Microsoft.JSInterop.Infrastructure /// Gets the name of the assembly containing the method. /// Only one of or may be specified. /// - public string AssemblyName { get; } + public string? AssemblyName { get; } /// /// Gets the identifier of the method to be invoked. This is the value specified in the . @@ -43,6 +43,6 @@ namespace Microsoft.JSInterop.Infrastructure /// /// Gets the call identifier. This value is when the client does not expect a value to be returned. /// - public string CallId { get; } + public string? CallId { get; } } } diff --git a/src/JSInterop/Microsoft.JSInterop/src/JSInProcessRuntime.cs b/src/JSInterop/Microsoft.JSInterop/src/JSInProcessRuntime.cs index 5125cbd701..04ace4eb3a 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/JSRuntime.cs b/src/JSInterop/Microsoft.JSInterop/src/JSRuntime.cs index b59e987686..ff11668dd7 100644 --- a/src/JSInterop/Microsoft.JSInterop/src/JSRuntime.cs +++ b/src/JSInterop/Microsoft.JSInterop/src/JSRuntime.cs @@ -62,7 +62,7 @@ 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. - public async ValueTask InvokeAsync(string identifier, object[] args) + public async ValueTask InvokeAsync(string identifier, object?[]? args) { if (DefaultAsyncTimeout.HasValue) { @@ -85,7 +85,7 @@ namespace Microsoft.JSInterop /// /// JSON-serializable arguments. /// An instance of obtained by JSON-deserializing the return value. - public ValueTask InvokeAsync(string identifier, CancellationToken cancellationToken, object[] args) + public ValueTask InvokeAsync(string identifier, CancellationToken cancellationToken, object?[]? args) { var taskId = Interlocked.Increment(ref _nextPendingTaskId); var tcs = new TaskCompletionSource(TaskContinuationOptions.RunContinuationsAsynchronously);