diff --git a/src/OrchardCore.Modules/OrchardCore.AdminMenu/Controllers/NodeController.cs b/src/OrchardCore.Modules/OrchardCore.AdminMenu/Controllers/NodeController.cs index dd3c9010614..56567072107 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminMenu/Controllers/NodeController.cs +++ b/src/OrchardCore.Modules/OrchardCore.AdminMenu/Controllers/NodeController.cs @@ -68,8 +68,8 @@ private async Task BuildDisplayViewModel(Models.AdminMen foreach (var factory in _factories) { var treeNode = factory.Create(); - dynamic thumbnail = await _displayManager.BuildDisplayAsync(treeNode, _updateModelAccessor.ModelUpdater, "TreeThumbnail"); - thumbnail.TreeNode = treeNode; + var thumbnail = await _displayManager.BuildDisplayAsync(treeNode, _updateModelAccessor.ModelUpdater, "TreeThumbnail"); + thumbnail.Properties["TreeNode"] = treeNode; thumbnails.Add(factory.Name, thumbnail); } @@ -138,8 +138,8 @@ public async Task Create(AdminNodeEditViewModel model) return NotFound(); } - dynamic editor = await _displayManager.UpdateEditorAsync(treeNode, updater: _updateModelAccessor.ModelUpdater, isNew: true, "", ""); - editor.TreeNode = treeNode; + var editor = await _displayManager.UpdateEditorAsync(treeNode, updater: _updateModelAccessor.ModelUpdater, isNew: true, "", ""); + editor.Properties["TreeNode"] = treeNode; if (ModelState.IsValid) { diff --git a/src/OrchardCore.Modules/OrchardCore.AdminMenu/Views/MenuItem.TreeSummary.cshtml b/src/OrchardCore.Modules/OrchardCore.AdminMenu/Views/MenuItem.TreeSummary.cshtml index 9c9915b5810..0cda87a7596 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminMenu/Views/MenuItem.TreeSummary.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.AdminMenu/Views/MenuItem.TreeSummary.cshtml @@ -72,10 +72,10 @@ @foreach (var child in children) { - dynamic adminNodeShape = await MenuItemDisplayManager.BuildDisplayAsync(child, updater, "TreeSummary"); - adminNodeShape.AdminMenuId = Model.AdminMenuId; - adminNodeShape.MenuItem = child; - adminNodeShape.Index = Model.Index + "-" + index++; + var adminNodeShape = await MenuItemDisplayManager.BuildDisplayAsync(child, updater, "TreeSummary"); + adminNodeShape.Properties["AdminMenuId"] = Model.AdminMenuId; + adminNodeShape.Properties["MenuItem"] = child; + adminNodeShape.Properties["Index"] = Model.Index + "-" + index++; @await DisplayAsync(adminNodeShape); } } diff --git a/src/OrchardCore.Modules/OrchardCore.AdminMenu/Views/Node/List.cshtml b/src/OrchardCore.Modules/OrchardCore.AdminMenu/Views/Node/List.cshtml index d73f1b7481e..58efb647d2b 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminMenu/Views/Node/List.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.AdminMenu/Views/Node/List.cshtml @@ -37,10 +37,10 @@ { if (menuItem != null) { - dynamic adminNodeShape = await MenuItemDisplayManager.BuildDisplayAsync(menuItem, updater, "TreeSummary"); - adminNodeShape.AdminMenuId = Model.AdminMenu.Id; - adminNodeShape.MenuItem = menuItem; - adminNodeShape.Index = index++; + var adminNodeShape = await MenuItemDisplayManager.BuildDisplayAsync(menuItem, updater, "TreeSummary"); + adminNodeShape.Properties["AdminMenuId"] = Model.AdminMenu.Id; + adminNodeShape.Properties["MenuItem"] = menuItem; + adminNodeShape.Properties["Index"] = index++; @await DisplayAsync(adminNodeShape) } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/DefaultContentDefinitionDisplayManager.cs b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/DefaultContentDefinitionDisplayManager.cs index a4a02a639d6..680ffbe3a6b 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/DefaultContentDefinitionDisplayManager.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Editors/DefaultContentDefinitionDisplayManager.cs @@ -44,8 +44,8 @@ public async Task BuildTypeEditorAsync(ContentTypeDefinition contentTyp { ArgumentNullException.ThrowIfNull(contentTypeDefinition); - dynamic contentTypeDefinitionShape = await CreateContentShapeAsync("ContentTypeDefinition_Edit"); - contentTypeDefinitionShape.ContentTypeDefinition = contentTypeDefinition; + var contentTypeDefinitionShape = await CreateContentShapeAsync("ContentTypeDefinition_Edit"); + contentTypeDefinitionShape.Properties["ContentTypeDefinition"] = contentTypeDefinition; var typeContext = new BuildEditorContext( contentTypeDefinitionShape, @@ -68,8 +68,8 @@ public async Task UpdateTypeEditorAsync(ContentTypeDefinition contentTy { ArgumentNullException.ThrowIfNull(contentTypeDefinition); - dynamic contentTypeDefinitionShape = await CreateContentShapeAsync("ContentTypeDefinition_Edit"); - contentTypeDefinitionShape.ContentTypeDefinition = contentTypeDefinition; + var contentTypeDefinitionShape = await CreateContentShapeAsync("ContentTypeDefinition_Edit"); + contentTypeDefinitionShape.Properties["ContentTypeDefinition"] = contentTypeDefinition; var layout = await _layoutAccessor.GetLayoutAsync(); @@ -149,8 +149,8 @@ public async Task BuildTypePartEditorAsync(ContentTypePartDefinition co { ArgumentNullException.ThrowIfNull(contentTypePartDefinition); - dynamic typePartDefinitionShape = await CreateContentShapeAsync("ContentTypePartDefinition_Edit"); - typePartDefinitionShape.ContentPart = contentTypePartDefinition; + var typePartDefinitionShape = await CreateContentShapeAsync("ContentTypePartDefinition_Edit"); + typePartDefinitionShape.Properties["ContentPart"] = contentTypePartDefinition; var partContext = new BuildEditorContext( typePartDefinitionShape, @@ -173,14 +173,14 @@ public async Task UpdateTypePartEditorAsync(ContentTypePartDefinition c { ArgumentNullException.ThrowIfNull(contentTypePartDefinition); - dynamic typePartDefinitionShape = await CreateContentShapeAsync("ContentTypePartDefinition_Edit"); + var typePartDefinitionShape = await CreateContentShapeAsync("ContentTypePartDefinition_Edit"); var layout = await _layoutAccessor.GetLayoutAsync(); await _contentDefinitionManager.AlterTypeDefinitionAsync(contentTypePartDefinition.ContentTypeDefinition.Name, typeBuilder => { return typeBuilder.WithPartAsync(contentTypePartDefinition.Name, async typePartBuilder => { - typePartDefinitionShape.ContentPart = contentTypePartDefinition; + typePartDefinitionShape.Properties["ContentPart"] = contentTypePartDefinition; var partContext = new UpdateTypePartEditorContext( typePartBuilder, @@ -205,8 +205,8 @@ public async Task BuildPartFieldEditorAsync(ContentPartFieldDefinition { ArgumentNullException.ThrowIfNull(contentPartFieldDefinition); - dynamic partFieldDefinitionShape = await CreateContentShapeAsync("ContentPartFieldDefinition_Edit"); - partFieldDefinitionShape.ContentField = contentPartFieldDefinition; + var partFieldDefinitionShape = await CreateContentShapeAsync("ContentPartFieldDefinition_Edit"); + partFieldDefinitionShape.Properties["ContentField"] = contentPartFieldDefinition; var fieldContext = new BuildEditorContext( partFieldDefinitionShape, @@ -230,7 +230,7 @@ public async Task UpdatePartFieldEditorAsync(ContentPartFieldDefinition ArgumentNullException.ThrowIfNull(contentPartFieldDefinition); var contentPartDefinition = contentPartFieldDefinition.PartDefinition; - dynamic partFieldDefinitionShape = await CreateContentShapeAsync("ContentPartFieldDefinition_Edit"); + var partFieldDefinitionShape = await CreateContentShapeAsync("ContentPartFieldDefinition_Edit"); var layout = await _layoutAccessor.GetLayoutAsync(); @@ -238,7 +238,7 @@ await _contentDefinitionManager.AlterPartDefinitionAsync(contentPartDefinition.N { return partBuilder.WithFieldAsync(contentPartFieldDefinition.Name, async partFieldBuilder => { - partFieldDefinitionShape.ContentField = contentPartFieldDefinition; + partFieldDefinitionShape.Properties["ContentField"] = contentPartFieldDefinition; var fieldContext = new UpdatePartFieldEditorContext( partFieldBuilder, diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/EditField.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/EditField.cshtml index 101112342e1..1529f1f130f 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/EditField.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/EditField.cshtml @@ -56,8 +56,8 @@ @@ -75,8 +75,8 @@ diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/EditTypePart.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/EditTypePart.cshtml index a5b28618d77..4bf78e4df6e 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/EditTypePart.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/EditTypePart.cshtml @@ -61,8 +61,8 @@ @@ -80,8 +80,8 @@ diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Controllers/AdminController.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Controllers/AdminController.cs index 6a4796edce4..3521aba8fee 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Controllers/AdminController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Controllers/AdminController.cs @@ -192,7 +192,7 @@ public async Task List( ? pagerOptions.Value.MaxPagedCount : await query.CountAsync(); - dynamic pagerShape = await shapeFactory.PagerAsync(pager, itemsPerPage, options.RouteValues); + var pagerShape = await shapeFactory.PagerAsync(pager, itemsPerPage, options.RouteValues); // Load items so that loading handlers are invoked. var pageOfContentItems = await query.Skip(pager.GetStartIndex()) @@ -207,11 +207,11 @@ public async Task List( } // Populate options pager summary values. - var startIndex = (pagerShape.Page - 1) * pagerShape.PageSize + 1; + var startIndex = (pager.Page - 1) * pager.PageSize + 1; options.StartIndex = startIndex; options.EndIndex = startIndex + contentItemSummaries.Count - 1; options.ContentItemsCount = contentItemSummaries.Count; - options.TotalItemCount = pagerShape.TotalItemCount; + options.TotalItemCount = itemsPerPage; var header = await _contentOptionsDisplayManager.BuildEditorAsync(options, this, false, string.Empty, string.Empty); diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Views/ContentsAdminList.Fields.BulkActions.cshtml b/src/OrchardCore.Modules/OrchardCore.Contents/Views/ContentsAdminList.Fields.BulkActions.cshtml index 1d44728ac23..70c41b01cca 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Views/ContentsAdminList.Fields.BulkActions.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Views/ContentsAdminList.Fields.BulkActions.cshtml @@ -7,8 +7,11 @@ diff --git a/src/OrchardCore.Modules/OrchardCore.Demo/ContentElementDisplays/TestContentElementDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.Demo/ContentElementDisplays/TestContentElementDisplayDriver.cs index 0f2e1c7164b..f992d1da8af 100644 --- a/src/OrchardCore.Modules/OrchardCore.Demo/ContentElementDisplays/TestContentElementDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.Demo/ContentElementDisplays/TestContentElementDisplayDriver.cs @@ -32,7 +32,8 @@ public override IDisplayResult Display(ContentItem contentItem, IUpdateModel upd async ctx => (await ctx.New.TestContentPartA()).Creating(_creating++), shape => { - ((dynamic)shape).Processing = _processing++; + shape.Properties["Processing"] = _processing++; + return Task.CompletedTask; }) .Location("Detail", "Content") diff --git a/src/OrchardCore.Modules/OrchardCore.Demo/Views/Home/DisplayShape.cshtml b/src/OrchardCore.Modules/OrchardCore.Demo/Views/Home/DisplayShape.cshtml index ea0fa58748b..3ec26e02c9c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Demo/Views/Home/DisplayShape.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Demo/Views/Home/DisplayShape.cshtml @@ -11,7 +11,7 @@ @await DisplayAsync(Model) @* - We can still call the DisplHelper with methods + We can still call the DisplayHelper with methods *@ @await New.Bar() diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment/Controllers/DeploymentPlanController.cs b/src/OrchardCore.Modules/OrchardCore.Deployment/Controllers/DeploymentPlanController.cs index 8aac781a8a8..73d0435b812 100644 --- a/src/OrchardCore.Modules/OrchardCore.Deployment/Controllers/DeploymentPlanController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Deployment/Controllers/DeploymentPlanController.cs @@ -173,8 +173,8 @@ public async Task Display(long id) var items = new List(); foreach (var step in deploymentPlan.DeploymentSteps) { - dynamic item = await _displayManager.BuildDisplayAsync(step, _updateModelAccessor.ModelUpdater, "Summary"); - item.DeploymentStep = step; + var item = await _displayManager.BuildDisplayAsync(step, _updateModelAccessor.ModelUpdater, "Summary"); + item.Properties["DeploymentStep"] = step; items.Add(item); } @@ -182,8 +182,8 @@ public async Task Display(long id) foreach (var factory in _factories) { var step = factory.Create(); - dynamic thumbnail = await _displayManager.BuildDisplayAsync(step, _updateModelAccessor.ModelUpdater, "Thumbnail"); - thumbnail.DeploymentStep = step; + var thumbnail = await _displayManager.BuildDisplayAsync(step, _updateModelAccessor.ModelUpdater, "Thumbnail"); + thumbnail.Properties["DeploymentStep"] = step; thumbnails.Add(factory.Name, thumbnail); } diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment/Controllers/StepController.cs b/src/OrchardCore.Modules/OrchardCore.Deployment/Controllers/StepController.cs index ff2167b0e73..1818f16fbd4 100644 --- a/src/OrchardCore.Modules/OrchardCore.Deployment/Controllers/StepController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Deployment/Controllers/StepController.cs @@ -104,8 +104,8 @@ public async Task Create(EditDeploymentPlanStepViewModel model) return NotFound(); } - dynamic editor = await _displayManager.UpdateEditorAsync(step, updater: _updateModelAccessor.ModelUpdater, isNew: true, "", ""); - editor.DeploymentStep = step; + var editor = await _displayManager.UpdateEditorAsync(step, updater: _updateModelAccessor.ModelUpdater, isNew: true, string.Empty, string.Empty); + editor.Properties["DeploymentStep"] = step; if (ModelState.IsValid) { diff --git a/src/OrchardCore.Modules/OrchardCore.Flows/Controllers/AdminController.cs b/src/OrchardCore.Modules/OrchardCore.Flows/Controllers/AdminController.cs index 1f09fda5cc8..db2c0cd9e69 100644 --- a/src/OrchardCore.Modules/OrchardCore.Flows/Controllers/AdminController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Flows/Controllers/AdminController.cs @@ -67,7 +67,7 @@ public async Task BuildEditor(string id, string prefix, string pr } // Create a Card Shape - dynamic contentCard = await _shapeFactory.New.ContentCard( + var contentCard = await _shapeFactory.New.ContentCard( // Updater is the controller for AJAX Requests Updater: _updateModelAccessor.ModelUpdater, // Shape Specific diff --git a/src/OrchardCore.Modules/OrchardCore.Layers/Controllers/AdminController.cs b/src/OrchardCore.Modules/OrchardCore.Layers/Controllers/AdminController.cs index c93048e9855..81e53934b67 100644 --- a/src/OrchardCore.Modules/OrchardCore.Layers/Controllers/AdminController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Layers/Controllers/AdminController.cs @@ -198,16 +198,16 @@ public async Task Edit(string name) return NotFound(); } - dynamic rule = await _ruleDisplayManager.BuildDisplayAsync(layer.LayerRule, _updateModelAccessor.ModelUpdater, "Summary"); - rule.ConditionId = layer.LayerRule.ConditionId; + var rule = await _ruleDisplayManager.BuildDisplayAsync(layer.LayerRule, _updateModelAccessor.ModelUpdater, "Summary"); + rule.Properties["ConditionId"] = layer.LayerRule.ConditionId; var thumbnails = new Dictionary(); foreach (var factory in _conditionFactories) { var condition = factory.Create(); - dynamic thumbnail = await _conditionDisplayManager.BuildDisplayAsync(condition, _updateModelAccessor.ModelUpdater, "Thumbnail"); - thumbnail.Condition = condition; - thumbnail.TargetUrl = Url.ActionLink("Create", "LayerRule", new { name, type = factory.Name }); + var thumbnail = await _conditionDisplayManager.BuildDisplayAsync(condition, _updateModelAccessor.ModelUpdater, "Thumbnail"); + thumbnail.Properties["Condition"] = condition; + thumbnail.Properties["TargetUrl"] = Url.ActionLink("Create", "LayerRule", new { name, type = factory.Name }); thumbnails.Add(factory.Name, thumbnail); } diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/Controllers/AdminController.cs b/src/OrchardCore.Modules/OrchardCore.Menu/Controllers/AdminController.cs index 563bbea837e..a624d60a69a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Menu/Controllers/AdminController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Menu/Controllers/AdminController.cs @@ -63,10 +63,10 @@ public async Task Create(string id, string menuContentItemId, str var contentItem = await _contentManager.NewAsync(id); - dynamic model = await _contentItemDisplayManager.BuildEditorAsync(contentItem, _updateModelAccessor.ModelUpdater, true); + var model = await _contentItemDisplayManager.BuildEditorAsync(contentItem, _updateModelAccessor.ModelUpdater, true); - model.MenuContentItemId = menuContentItemId; - model.MenuItemId = menuItemId; + model.Properties["MenuContentItemId"] = menuContentItemId; + model.Properties["MenuItemId"] = menuItemId; return View(model); } @@ -100,12 +100,12 @@ public async Task CreatePost(string id, string menuContentItemId, var contentItem = await _contentManager.NewAsync(id); - dynamic model = await _contentItemDisplayManager.UpdateEditorAsync(contentItem, _updateModelAccessor.ModelUpdater, true); + var model = await _contentItemDisplayManager.UpdateEditorAsync(contentItem, _updateModelAccessor.ModelUpdater, true); if (!ModelState.IsValid) { - model.MenuContentItemId = menuContentItemId; - model.MenuItemId = menuItemId; + model.Properties["MenuContentItemId"] = menuContentItemId; + model.Properties["MenuItemId"] = menuItemId; return View(model); } @@ -169,10 +169,10 @@ public async Task Edit(string menuContentItemId, string menuItemI var contentItem = menuItem.ToObject(); - dynamic model = await _contentItemDisplayManager.BuildEditorAsync(contentItem, _updateModelAccessor.ModelUpdater, false); + var model = await _contentItemDisplayManager.BuildEditorAsync(contentItem, _updateModelAccessor.ModelUpdater, false); - model.MenuContentItemId = menuContentItemId; - model.MenuItemId = menuItemId; + model.Properties["MenuContentItemId"] = menuContentItemId; + model.Properties["MenuItemId"] = menuItemId; return View(model); } @@ -220,12 +220,12 @@ public async Task EditPost(string menuContentItemId, string menuI contentItem.Merge(existing); - dynamic model = await _contentItemDisplayManager.UpdateEditorAsync(contentItem, _updateModelAccessor.ModelUpdater, false); + var model = await _contentItemDisplayManager.UpdateEditorAsync(contentItem, _updateModelAccessor.ModelUpdater, false); if (!ModelState.IsValid) { - model.MenuContentItemId = menuContentItemId; - model.MenuItemId = menuItemId; + model.Properties["MenuContentItemId"] = menuContentItemId; + model.Properties["MenuItemId"] = menuItemId; return View(model); } diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/Views/MenuItem.Admin.cshtml b/src/OrchardCore.Modules/OrchardCore.Menu/Views/MenuItem.Admin.cshtml index ec07ec5f803..6b1ff3a358a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Menu/Views/MenuItem.Admin.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Menu/Views/MenuItem.Admin.cshtml @@ -56,10 +56,9 @@ diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/Views/MenuPart.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Menu/Views/MenuPart.Edit.cshtml index a9a91f4a3b4..3a62d3ad3fe 100644 --- a/src/OrchardCore.Modules/OrchardCore.Menu/Views/MenuPart.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Menu/Views/MenuPart.Edit.cshtml @@ -37,9 +37,9 @@ { if (Model.MenuItemContentTypes.Any(c => c.Name == menuItem.ContentType)) { - dynamic menuItemShape = await ContentItemDisplayManager.BuildDisplayAsync(menuItem, updater, "Admin"); - menuItemShape.MenuPart = Model.MenuPart; - menuItemShape.Index = index++; + var menuItemShape = await ContentItemDisplayManager.BuildDisplayAsync(menuItem, updater, "Admin"); + menuItemShape.Properties["MenuPart"] = Model.MenuPart; + menuItemShape.Properties["Index"] = index++; @await DisplayAsync(menuItemShape) } @@ -62,10 +62,10 @@ @foreach (var type in Model.MenuItemContentTypes) { var menuItem = await ContentManager.NewAsync(type.Name); - dynamic thumbnail = await ContentItemDisplayManager.BuildDisplayAsync(menuItem, updater, "Thumbnail"); - thumbnail.MenuItemType = type.Name; - thumbnail.MenuItemTypeDisplayName = type.DisplayName; - thumbnail.MenuContentItemId = Model.MenuPart.ContentItem.ContentItemId; + var thumbnail = await ContentItemDisplayManager.BuildDisplayAsync(menuItem, updater, "Thumbnail"); + thumbnail.Properties["MenuItemType"] = type.Name; + thumbnail.Properties["MenuItemTypeDisplayName"] = type.DisplayName; + thumbnail.Properties["MenuContentItemId"] = Model.MenuPart.ContentItem.ContentItemId;
@await DisplayAsync(thumbnail)
diff --git a/src/OrchardCore.Modules/OrchardCore.Rules/Views/Items/ConditionGroup.Fields.Summary.cshtml b/src/OrchardCore.Modules/OrchardCore.Rules/Views/Items/ConditionGroup.Fields.Summary.cshtml index 68e3615aa6f..5411c4849ce 100644 --- a/src/OrchardCore.Modules/OrchardCore.Rules/Views/Items/ConditionGroup.Fields.Summary.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Rules/Views/Items/ConditionGroup.Fields.Summary.cshtml @@ -11,8 +11,9 @@
    @foreach (var entry in Model.Entries) { - dynamic summary = await DisplayManager.BuildDisplayAsync(entry.Condition, null, "Summary"); - summary.Condition = entry.Condition; + var summary = await DisplayManager.BuildDisplayAsync(entry.Condition, null, "Summary"); + summary.Properties["Condition"] = entry.Condition; +
  1. @await DisplayAsync(summary)
  2. diff --git a/src/OrchardCore.Modules/OrchardCore.Shortcodes/Views/Admin/Create.cshtml b/src/OrchardCore.Modules/OrchardCore.Shortcodes/Views/Admin/Create.cshtml index e937722f0e9..9b915d4acac 100644 --- a/src/OrchardCore.Modules/OrchardCore.Shortcodes/Views/Admin/Create.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Shortcodes/Views/Admin/Create.cshtml @@ -96,8 +96,8 @@ diff --git a/src/OrchardCore.Modules/OrchardCore.Shortcodes/Views/Admin/Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Shortcodes/Views/Admin/Edit.cshtml index 3e357b8dd8a..6f8268262ca 100644 --- a/src/OrchardCore.Modules/OrchardCore.Shortcodes/Views/Admin/Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Shortcodes/Views/Admin/Edit.cshtml @@ -105,8 +105,8 @@ DefaultValue = Model.DefaultValue, Usage = Model.Usage }; - dynamic shape = await ShortcodeDescriptorDisplayManager.BuildDisplayAsync(descriptor, null, "SummaryAdmin"); - shape.Actions = null; + var shape = await ShortcodeDescriptorDisplayManager.BuildDisplayAsync(descriptor, null, "SummaryAdmin"); + shape.Properties["Actions"] = null; @await DisplayAsync(shape) } diff --git a/src/OrchardCore.Modules/OrchardCore.Sitemaps/Controllers/AdminController.cs b/src/OrchardCore.Modules/OrchardCore.Sitemaps/Controllers/AdminController.cs index 9cef43df1bb..7f6fd000557 100644 --- a/src/OrchardCore.Modules/OrchardCore.Sitemaps/Controllers/AdminController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Sitemaps/Controllers/AdminController.cs @@ -140,9 +140,9 @@ public async Task Display(string sitemapId) var items = new List(); foreach (var source in sitemap.SitemapSources) { - dynamic item = await _displayManager.BuildDisplayAsync(source, _updateModelAccessor.ModelUpdater, "SummaryAdmin"); - item.SitemapId = sitemap.SitemapId; - item.SitemapSource = source; + var item = await _displayManager.BuildDisplayAsync(source, _updateModelAccessor.ModelUpdater, "SummaryAdmin"); + item.Properties["SitemapId"] = sitemap.SitemapId; + item.Properties["SitemapSource"] = source; items.Add(item); } @@ -150,10 +150,11 @@ public async Task Display(string sitemapId) foreach (var factory in _sourceFactories) { var source = factory.Create(); - dynamic thumbnail = await _displayManager.BuildDisplayAsync(source, _updateModelAccessor.ModelUpdater, "Thumbnail"); - thumbnail.SitemapSource = source; - thumbnail.SitemapSourceType = factory.Name; - thumbnail.Sitemap = sitemap; + var thumbnail = await _displayManager.BuildDisplayAsync(source, _updateModelAccessor.ModelUpdater, "Thumbnail"); + thumbnail.Properties["SitemapSource"] = source; + thumbnail.Properties["SitemapSourceType"] = factory.Name; + thumbnail.Properties["Sitemap"] = sitemap; + thumbnails.Add(factory.Name, thumbnail); } diff --git a/src/OrchardCore.Modules/OrchardCore.Sitemaps/Controllers/SourceController.cs b/src/OrchardCore.Modules/OrchardCore.Sitemaps/Controllers/SourceController.cs index de98b278fe3..89140252c0b 100644 --- a/src/OrchardCore.Modules/OrchardCore.Sitemaps/Controllers/SourceController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Sitemaps/Controllers/SourceController.cs @@ -107,8 +107,8 @@ public async Task Create(CreateSourceViewModel model) return NotFound(); } - dynamic editor = await _displayManager.UpdateEditorAsync(source, updater: _updateModelAccessor.ModelUpdater, isNew: true, "", ""); - editor.SitemapStep = source; + var editor = await _displayManager.UpdateEditorAsync(source, updater: _updateModelAccessor.ModelUpdater, isNew: true, "", ""); + editor.Properties["SitemapStep"] = source; if (ModelState.IsValid) { diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/Controllers/AdminController.cs b/src/OrchardCore.Modules/OrchardCore.Taxonomies/Controllers/AdminController.cs index 882b33e6350..feb5cda7f2c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Taxonomies/Controllers/AdminController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/Controllers/AdminController.cs @@ -72,10 +72,10 @@ public async Task Create(string id, string taxonomyContentItemId, contentItem.Weld(); contentItem.Alter(t => t.TaxonomyContentItemId = taxonomyContentItemId); - dynamic model = await _contentItemDisplayManager.BuildEditorAsync(contentItem, _updateModelAccessor.ModelUpdater, true); + var model = await _contentItemDisplayManager.BuildEditorAsync(contentItem, _updateModelAccessor.ModelUpdater, true); - model.TaxonomyContentItemId = taxonomyContentItemId; - model.TaxonomyItemId = taxonomyItemId; + model.Properties["TaxonomyContentItemId"] = taxonomyContentItemId; + model.Properties["TaxonomyItemId"] = taxonomyItemId; return View(model); } @@ -121,12 +121,12 @@ public async Task CreatePost(string id, string taxonomyContentIte contentItem.Weld(); contentItem.Alter(t => t.TaxonomyContentItemId = taxonomyContentItemId); - dynamic model = await _contentItemDisplayManager.UpdateEditorAsync(contentItem, _updateModelAccessor.ModelUpdater, true); + var model = await _contentItemDisplayManager.UpdateEditorAsync(contentItem, _updateModelAccessor.ModelUpdater, true); if (!ModelState.IsValid) { - model.TaxonomyContentItemId = taxonomyContentItemId; - model.TaxonomyItemId = taxonomyItemId; + model.Properties["TaxonomyContentItemId"] = taxonomyContentItemId; + model.Properties["TaxonomyItemId"] = taxonomyItemId; return View(model); } @@ -195,10 +195,10 @@ public async Task Edit(string taxonomyContentItemId, string taxon contentItem.Weld(); contentItem.Alter(t => t.TaxonomyContentItemId = taxonomyContentItemId); - dynamic model = await _contentItemDisplayManager.BuildEditorAsync(contentItem, _updateModelAccessor.ModelUpdater, false); + var model = await _contentItemDisplayManager.BuildEditorAsync(contentItem, _updateModelAccessor.ModelUpdater, false); - model.TaxonomyContentItemId = taxonomyContentItemId; - model.TaxonomyItemId = taxonomyItemId; + model.Properties["TaxonomyContentItemId"] = taxonomyContentItemId; + model.Properties["TaxonomyItemId"] = taxonomyItemId; return View(model); } @@ -254,12 +254,12 @@ public async Task EditPost(string taxonomyContentItemId, string t contentItem.Weld(); contentItem.Alter(t => t.TaxonomyContentItemId = taxonomyContentItemId); - dynamic model = await _contentItemDisplayManager.UpdateEditorAsync(contentItem, _updateModelAccessor.ModelUpdater, false); + var model = await _contentItemDisplayManager.UpdateEditorAsync(contentItem, _updateModelAccessor.ModelUpdater, false); if (!ModelState.IsValid) { - model.TaxonomyContentItemId = taxonomyContentItemId; - model.TaxonomyItemId = taxonomyItemId; + model.Properties["TaxonomyContentItemId"] = taxonomyContentItemId; + model.Properties["TaxonomyItemId"] = taxonomyItemId; return View(model); } diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/Content.TermAdmin.cshtml b/src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/Content.TermAdmin.cshtml index fa6c90b4d0e..50c074329a1 100644 --- a/src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/Content.TermAdmin.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/Content.TermAdmin.cshtml @@ -54,9 +54,9 @@ @foreach (JsonObject termObject in termsArray) { var term = termObject.ToObject(); - dynamic termShape = await ContentItemDisplayManager.BuildDisplayAsync(term, updater, "TermAdmin"); - termShape.TaxonomyPart = Model.TaxonomyPart; - termShape.Index = Model.Index + "-" + index++; + var termShape = await ContentItemDisplayManager.BuildDisplayAsync(term, updater, "TermAdmin"); + termShape.Properties["TaxonomyPart"] = Model.TaxonomyPart; + termShape.Properties["Index"] = Model.Index + "-" + index++; @await DisplayAsync(termShape) }
diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/TaxonomyPart.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/TaxonomyPart.Edit.cshtml index 31c78e65b98..84f87e6670c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/TaxonomyPart.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/TaxonomyPart.Edit.cshtml @@ -52,9 +52,9 @@ diff --git a/src/OrchardCore.Modules/OrchardCore.Users/Controllers/AdminController.cs b/src/OrchardCore.Modules/OrchardCore.Users/Controllers/AdminController.cs index 6cd8a633dea..f696343d4d4 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/Controllers/AdminController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/Controllers/AdminController.cs @@ -121,7 +121,7 @@ public async Task Index([ModelBinder(BinderType = typeof(UserFilte .Take(pager.PageSize) .ListAsync(); - dynamic pagerShape = await _shapeFactory.PagerAsync(pager, count, options.RouteValues); + var pagerShape = await _shapeFactory.PagerAsync(pager, count, options.RouteValues); var userEntries = new List(); @@ -189,11 +189,11 @@ .. roleNames.Select(roleName => ]; // Populate options pager summary values. - var startIndex = (pagerShape.Page - 1) * pagerShape.PageSize + 1; + var startIndex = (pager.Page - 1) * pager.PageSize + 1; options.StartIndex = startIndex; options.EndIndex = startIndex + userEntries.Count - 1; options.UsersCount = userEntries.Count; - options.TotalItemCount = pagerShape.TotalItemCount; + options.TotalItemCount = count; var header = await _userOptionsDisplayManager.BuildEditorAsync(options, _updateModelAccessor.ModelUpdater, false, string.Empty, string.Empty); diff --git a/src/OrchardCore.Modules/OrchardCore.Users/Views/UsersAdminList.Fields.BulkActions.cshtml b/src/OrchardCore.Modules/OrchardCore.Users/Views/UsersAdminList.Fields.BulkActions.cshtml index 5a839be9388..a3045f3a514 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/Views/UsersAdminList.Fields.BulkActions.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Users/Views/UsersAdminList.Fields.BulkActions.cshtml @@ -8,8 +8,12 @@ diff --git a/src/OrchardCore.Modules/OrchardCore.Widgets/ContentCardShapes.cs b/src/OrchardCore.Modules/OrchardCore.Widgets/ContentCardShapes.cs index e52feb0c7dd..10bce64a4a1 100644 --- a/src/OrchardCore.Modules/OrchardCore.Widgets/ContentCardShapes.cs +++ b/src/OrchardCore.Modules/OrchardCore.Widgets/ContentCardShapes.cs @@ -1,4 +1,5 @@ using System.Threading.Tasks; +using OrchardCore.DisplayManagement; using OrchardCore.DisplayManagement.Descriptors; namespace OrchardCore.Widgets @@ -20,12 +21,12 @@ public override ValueTask DiscoverAsync(ShapeTableBuilder builder) .OnDisplaying(context => { // Defines Edit Alternates for the Content Item being edited. - dynamic contentCardEditor = context.Shape; - string collectionType = contentCardEditor.CollectionShapeType; - string contentType = contentCardEditor.ContentTypeValue; - string parentContentType = contentCardEditor.ParentContentType; - string namedPart = contentCardEditor.CollectionPartName; - if (contentCardEditor.BuildEditor == true) + var contentCardEditor = context.Shape; + var collectionType = contentCardEditor.GetProperty("CollectionShapeType"); + var contentType = contentCardEditor.GetProperty("ContentTypeValue"); + var parentContentType = contentCardEditor.GetProperty("ParentContentType"); + var namedPart = contentCardEditor.GetProperty("CollectionPartName"); + if (contentCardEditor.TryGetProperty("BuildEditor", out var buildEditor) && buildEditor) { // Define edit card shape per collection type // ContentCard_Edit__[CollectionType] @@ -135,8 +136,8 @@ public override ValueTask DiscoverAsync(ShapeTableBuilder builder) builder.Describe(ContentCardFieldsEdit) .OnDisplaying(context => { - dynamic contentCardEditorFields = context.Shape; - var collectionType = contentCardEditorFields.CardShape.CollectionShapeType as string; + var contentCardEditorFields = context.Shape; + var collectionType = contentCardEditorFields.GetProperty("CardShape").GetProperty("CollectionShapeType"); contentCardEditorFields.Metadata.Alternates.Add($"{collectionType}_Fields_Edit"); }); diff --git a/src/OrchardCore.Modules/OrchardCore.Widgets/Views/ContentCard.cshtml b/src/OrchardCore.Modules/OrchardCore.Widgets/Views/ContentCard.cshtml index 8f9eff72c52..2165e478e65 100644 --- a/src/OrchardCore.Modules/OrchardCore.Widgets/Views/ContentCard.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Widgets/Views/ContentCard.cshtml @@ -4,7 +4,7 @@ @{ var contentDefinitions = await ContentDefinitionManager.ListTypeDefinitionsAsync(); //Set Model (Current Shape) as Child content of Outer Frame, Later this Model is used to render other shapes - dynamic contentCardFrame = await New.ContentCard_Frame(); + var contentCardFrame = await New.ContentCard_Frame(); var contentItem = Model.ContentItem; Model.ContentTypeValue = contentItem.ContentType; @@ -25,15 +25,15 @@ //Build Editor for Content Item // AJAX request is new request and will not have CollectionShape. var isNew = Model.CollectionShape == null ? true : false; - dynamic contentItemEditor = await ContentItemDisplayManager.BuildEditorAsync(contentItem, updater, isNew, "", Model.PrefixValue); + var contentItemEditor = await ContentItemDisplayManager.BuildEditorAsync(contentItem, updater, isNew, string.Empty, Model.PrefixValue); //We don't show Actions and Side bar the parent editor has its own buttons. - contentItemEditor.Actions = null; - contentItemEditor.Sidebar = null; + contentItemEditor.Properties["Actions"] = null; + contentItemEditor.Properties["Sidebar"] = null; //Move Content Footer to Card Footer, if any - Model.Footer = contentItemEditor.Footer; - contentItemEditor.Footer = null; + Model.Footer = contentItemEditor.GetProperty("Footer"); + contentItemEditor.Properties["Footer"] = null; Model.ContentEditor = contentItemEditor; @@ -48,8 +48,7 @@ else { //Just Create Preview - dynamic contentDisplay = await ContentItemDisplayManager.BuildDisplayAsync(contentItem, updater, Model.DisplayType ?? "Detail"); - Model.ContentPreview = contentDisplay; + Model.ContentPreview = await ContentItemDisplayManager.BuildDisplayAsync(contentItem, updater, Model.DisplayType ?? "Detail"); //Hide the Delete Model.CanDelete = false; diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowController.cs b/src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowController.cs index bdc6037d46d..71409532e9b 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowController.cs @@ -332,12 +332,13 @@ public async Task BulkEdit(long workflowTypeId, WorkflowIndexOpti private async Task BuildActivityDisplayAsync(ActivityContext activityContext, long workflowTypeId, bool isBlocking, string displayType) { - dynamic activityShape = await _activityDisplayManager.BuildDisplayAsync(activityContext.Activity, _updateModelAccessor.ModelUpdater, displayType); + var activityShape = await _activityDisplayManager.BuildDisplayAsync(activityContext.Activity, _updateModelAccessor.ModelUpdater, displayType); activityShape.Metadata.Type = $"Activity_{displayType}ReadOnly"; - activityShape.Activity = activityContext.Activity; - activityShape.ActivityRecord = activityContext.ActivityRecord; - activityShape.WorkflowTypeId = workflowTypeId; - activityShape.IsBlocking = isBlocking; + activityShape.Properties["Activity"] = activityContext.Activity; + activityShape.Properties["ActivityRecord"] = activityContext.ActivityRecord; + activityShape.Properties["WorkflowTypeId"] = workflowTypeId; + activityShape.Properties["IsBlocking"] = isBlocking; + return activityShape; } } diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs b/src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs index 1c6096d3ede..c6258ce73b5 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs @@ -515,14 +515,12 @@ public async Task Delete(long id) private async Task BuildActivityDisplay(IActivity activity, int index, long workflowTypeId, string localId, string displayType) { - dynamic activityShape = - await _activityDisplayManager.BuildDisplayAsync(activity, _updateModelAccessor.ModelUpdater, - displayType); + var activityShape = await _activityDisplayManager.BuildDisplayAsync(activity, _updateModelAccessor.ModelUpdater, displayType); activityShape.Metadata.Type = $"Activity_{displayType}"; - activityShape.Activity = activity; - activityShape.WorkflowTypeId = workflowTypeId; - activityShape.Index = index; - activityShape.ReturnUrl = Url.Action(nameof(Edit), new + activityShape.Properties["Activity"] = activity; + activityShape.Properties["WorkflowTypeId"] = workflowTypeId; + activityShape.Properties["Index"] = index; + activityShape.Properties["ReturnUrl"] = Url.Action(nameof(Edit), new { id = workflowTypeId, localId, @@ -534,14 +532,13 @@ await _activityDisplayManager.BuildDisplayAsync(activity, _updateModelAccessor.M private async Task BuildActivityDisplay(ActivityContext activityContext, int index, long workflowTypeId, string localId, string displayType) { - dynamic activityShape = await _activityDisplayManager.BuildDisplayAsync(activityContext.Activity, - _updateModelAccessor.ModelUpdater, displayType); + var activityShape = await _activityDisplayManager.BuildDisplayAsync(activityContext.Activity, _updateModelAccessor.ModelUpdater, displayType); activityShape.Metadata.Type = $"Activity_{displayType}"; - activityShape.Activity = activityContext.Activity; - activityShape.ActivityRecord = activityContext.ActivityRecord; - activityShape.WorkflowTypeId = workflowTypeId; - activityShape.Index = index; - activityShape.ReturnUrl = Url.Action(nameof(Edit), new + activityShape.Properties["Activity"] = activityContext.Activity; + activityShape.Properties["ActivityRecord"] = activityContext.ActivityRecord; + activityShape.Properties["WorkflowTypeId"] = workflowTypeId; + activityShape.Properties["Index"] = index; + activityShape.Properties["ReturnUrl"] = Url.Action(nameof(Edit), new { id = workflowTypeId, localId, diff --git a/src/OrchardCore/OrchardCore.DisplayManagement/Handlers/DisplayDriverBase.cs b/src/OrchardCore/OrchardCore.DisplayManagement/Handlers/DisplayDriverBase.cs index 053ba72d1cf..0339d273d59 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement/Handlers/DisplayDriverBase.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement/Handlers/DisplayDriverBase.cs @@ -71,7 +71,7 @@ public ShapeResult Dynamic(string shapeType, Func initializeAsync return Factory(shapeType, async ctx => { - dynamic shape = await ctx.ShapeFactory.CreateAsync(shapeType); + var shape = await ctx.ShapeFactory.CreateAsync(shapeType); await initializeAsync(shape); return shape; }); @@ -85,7 +85,7 @@ public ShapeResult Dynamic(string shapeType, Action initialize) return Factory(shapeType, async ctx => { - dynamic shape = await ctx.ShapeFactory.CreateAsync(shapeType); + var shape = await ctx.ShapeFactory.CreateAsync(shapeType); initialize(shape); return shape; }); diff --git a/src/OrchardCore/OrchardCore.DisplayManagement/Shapes/CoreShapes.cs b/src/OrchardCore/OrchardCore.DisplayManagement/Shapes/CoreShapes.cs index 070b1594679..c68ec5e1c05 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement/Shapes/CoreShapes.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement/Shapes/CoreShapes.cs @@ -126,12 +126,10 @@ public override ValueTask DiscoverAsync(ShapeTableBuilder builder) builder.Describe("List") .OnCreated(created => { - dynamic list = created.Shape; - - // Intializes the common properties of a List shape + // Initializes the common properties of a List shape // such that views can safely add values to them. - list.ItemClasses = new List(); - list.ItemAttributes = new Dictionary(); + created.Shape.Properties["ItemClasses"] = new List(); + created.Shape.Properties["ItemAttributes"] = new Dictionary(); }); return ValueTask.CompletedTask; diff --git a/src/OrchardCore/OrchardCore.DisplayManagement/TagHelpers/DateTimeTagHelper.cs b/src/OrchardCore/OrchardCore.DisplayManagement/TagHelpers/DateTimeTagHelper.cs index 9a585bebe92..a5c71e683d0 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement/TagHelpers/DateTimeTagHelper.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement/TagHelpers/DateTimeTagHelper.cs @@ -28,9 +28,9 @@ public DateTimeTagHelper(IShapeFactory shapeFactory, IDisplayHelper displayHelpe public async override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { var shapeType = "DateTime"; - dynamic shape = await _shapeFactory.CreateAsync(shapeType); - shape.Utc = Utc; - shape.Format = Format; + var shape = await _shapeFactory.CreateAsync(shapeType); + shape.Properties["Utc"] = Utc; + shape.Properties["Format"] = Format; output.Content.SetHtmlContent(await _displayHelper.ShapeExecuteAsync(shape)); diff --git a/src/OrchardCore/OrchardCore.DisplayManagement/TagHelpers/TimeSpanTagHelper.cs b/src/OrchardCore/OrchardCore.DisplayManagement/TagHelpers/TimeSpanTagHelper.cs index aeecb9c99c9..186c30b167e 100644 --- a/src/OrchardCore/OrchardCore.DisplayManagement/TagHelpers/TimeSpanTagHelper.cs +++ b/src/OrchardCore/OrchardCore.DisplayManagement/TagHelpers/TimeSpanTagHelper.cs @@ -28,9 +28,9 @@ public TimeSpanTagHelper(IShapeFactory shapeFactory, IDisplayHelper displayHelpe public async override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { var shapeType = "TimeSpan"; - dynamic shape = await _shapeFactory.CreateAsync(shapeType); - shape.Utc = Utc; - shape.Origin = Origin; + var shape = await _shapeFactory.CreateAsync(shapeType); + shape.Properties["Utc"] = Utc; + shape.Properties["Origin"] = Origin; output.Content.SetHtmlContent(await _displayHelper.ShapeExecuteAsync(shape));