From 0965570d737bebfdaf386e0c9bd94b3363160a6b Mon Sep 17 00:00:00 2001 From: Robert Haken Date: Mon, 14 Oct 2024 16:20:39 +0200 Subject: [PATCH] [Blazor] Call .NET from JS - OperatingSystem.IsBrowser() (#33846) --- .../call-dotnet-from-javascript.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/aspnetcore/blazor/javascript-interoperability/call-dotnet-from-javascript.md b/aspnetcore/blazor/javascript-interoperability/call-dotnet-from-javascript.md index b8cbc95b44..39de6d3079 100644 --- a/aspnetcore/blazor/javascript-interoperability/call-dotnet-from-javascript.md +++ b/aspnetcore/blazor/javascript-interoperability/call-dotnet-from-javascript.md @@ -786,7 +786,6 @@ In the following `GenericsExample` component: ```razor @page "/generics-example" -@using System.Runtime.InteropServices @implements IDisposable @inject IJSRuntime JS @@ -813,8 +812,7 @@ In the following `GenericsExample` component: public async Task InvokeInterop() { - var syncInterop = - RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER")); + var syncInterop = OperatingSystem.IsBrowser(); await JS.InvokeVoidAsync( "invokeMethodsAsync", syncInterop, objRef1, objRef2); @@ -834,7 +832,6 @@ In the following `GenericsExample` component: ```razor @page "/generics-example" -@using System.Runtime.InteropServices @implements IDisposable @inject IJSRuntime JS @@ -861,8 +858,7 @@ In the following `GenericsExample` component: public async Task InvokeInterop() { - var syncInterop = - RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER")); + var syncInterop = OperatingSystem.IsBrowser(); await JS.InvokeVoidAsync( "invokeMethodsAsync", syncInterop, objRef1, objRef2);