Skip to content

Commit 48f918d

Browse files
authored
Avoid circular references in Blazor JS interop (#17652)
1 parent 40c73f9 commit 48f918d

2 files changed

Lines changed: 26 additions & 2 deletions

File tree

aspnetcore/blazor/call-dotnet-from-javascript.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to invoke .NET methods from JavaScript functions in Blazo
55
monikerRange: '>= aspnetcore-3.1'
66
ms.author: riande
77
ms.custom: mvc
8-
ms.date: 03/24/2020
8+
ms.date: 04/07/2020
99
no-loc: [Blazor, SignalR]
1010
uid: blazor/call-dotnet-from-javascript
1111
---
@@ -352,6 +352,18 @@ window.updateMessageCallerJS = (dotnetHelper) => {
352352

353353
[!INCLUDE[Share interop code in a class library](~/includes/blazor-share-interop-code.md)]
354354

355+
## Avoid circular object references
356+
357+
Objects that contain circular references can't be serialized on the client for either:
358+
359+
* .NET method calls.
360+
* JavaScript method calls from C# when the return type has circular references.
361+
362+
For more information, see the following issues:
363+
364+
* [Circular references are not supported, take two (dotnet/aspnetcore #20525)](https://github.com/dotnet/aspnetcore/issues/20525)
365+
* [Proposal: Add mechanism to handle circular references when serializing (dotnet/runtime #30820)](https://github.com/dotnet/runtime/issues/30820)
366+
355367
## Additional resources
356368

357369
* <xref:blazor/call-javascript-from-dotnet>

aspnetcore/blazor/call-javascript-from-dotnet.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to invoke JavaScript functions from .NET methods in Blazo
55
monikerRange: '>= aspnetcore-3.1'
66
ms.author: riande
77
ms.custom: mvc
8-
ms.date: 02/19/2020
8+
ms.date: 04/07/2020
99
no-loc: [Blazor, SignalR]
1010
uid: blazor/call-javascript-from-dotnet
1111
---
@@ -454,6 +454,18 @@ For more information on resource exhaustion, see <xref:security/blazor/server>.
454454

455455
[!INCLUDE[Share interop code in a class library](~/includes/blazor-share-interop-code.md)]
456456

457+
## Avoid circular object references
458+
459+
Objects that contain circular references can't be serialized on the client for either:
460+
461+
* .NET method calls.
462+
* JavaScript method calls from C# when the return type has circular references.
463+
464+
For more information, see the following issues:
465+
466+
* [Circular references are not supported, take two (dotnet/aspnetcore #20525)](https://github.com/dotnet/aspnetcore/issues/20525)
467+
* [Proposal: Add mechanism to handle circular references when serializing (dotnet/runtime #30820)](https://github.com/dotnet/runtime/issues/30820)
468+
457469
## Additional resources
458470

459471
* <xref:blazor/call-dotnet-from-javascript>

0 commit comments

Comments
 (0)