@page "/counter" @using System.Dynamic

Counter

@foreach (var option in (IDictionary)selectedProduct.Properties) {
} @code { private dynamic selectedProduct = new ExpandoObject(); private IDictionary product; private dynamic expnProduct = new ExpandoObject(); protected override async Task OnInitializedAsync() { Dictionary properties = new Dictionary(); properties.Add("color", "red"); properties.Add("size", "100*100"); properties.Add("weight", "10kg"); selectedProduct.Properties = properties; product = (IDictionary ) expnProduct; product["color"] = "red"; product["size"] = 100; product["weight"] = 10.50D; expnProduct.name = "Product One"; // product["name"] = "Product one" expnProduct.date = DateTime.Today; } private void CheckValue() { var data = selectedProduct; } }