From a4fa11c881235bd57ec8cdb03952dc1db6360a8d Mon Sep 17 00:00:00 2001 From: vnetonline Date: Thu, 17 Aug 2023 10:44:52 +1000 Subject: [PATCH] [ENHANCE] - Change to ExpandoObject instead of an Anonymous Object Anonymous Object are not able to be used across assemblies however ExpandoObject is refer to #3145 --- Oqtane.Client/Modules/ModuleBase.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Oqtane.Client/Modules/ModuleBase.cs b/Oqtane.Client/Modules/ModuleBase.cs index f1a086e59..418129236 100644 --- a/Oqtane.Client/Modules/ModuleBase.cs +++ b/Oqtane.Client/Modules/ModuleBase.cs @@ -9,6 +9,7 @@ using System.Collections.Generic; using Microsoft.JSInterop; using System.Linq; +using System.Dynamic; namespace Oqtane.Modules { @@ -280,13 +281,17 @@ public void HideProgressIndicator() public void SetModuleTitle(string title) { - var obj = new { PageModuleId = ModuleState.PageModuleId, Title = title }; + dynamic obj = new ExpandoObject(); + obj.PageModuleId = ModuleState.PageModuleId; + obj.Title = title; SiteState.Properties.ModuleTitle = obj; } public void SetModuleVisibility(bool visible) { - var obj = new { PageModuleId = ModuleState.PageModuleId, Visible = visible }; + dynamic obj = new ExpandoObject(); + obj.PageModuleId = ModuleState.PageModuleId; + obj.Visible = visible; SiteState.Properties.ModuleVisibility = obj; }