diff --git a/aspnetcore/blazor/common/samples/3.x/BlazorSample/JsInteropClasses/ExampleJsInterop.cs b/aspnetcore/blazor/common/samples/3.x/BlazorSample/JsInteropClasses/ExampleJsInterop.cs index d19d161709..b873a5c6e2 100644 --- a/aspnetcore/blazor/common/samples/3.x/BlazorSample/JsInteropClasses/ExampleJsInterop.cs +++ b/aspnetcore/blazor/common/samples/3.x/BlazorSample/JsInteropClasses/ExampleJsInterop.cs @@ -22,7 +22,7 @@ namespace BlazorSample.JsInteropClasses // sayHello is implemented in wwwroot/exampleJsInterop.js return _jsRuntime.InvokeAsync( "exampleJsFunctions.sayHello", - new DotNetObjectRef(new HelloHelper(name))); + DotNetObjectRef.Create(new HelloHelper(name))); } } #endregion