@page "/counter" @using System.Dynamic

Counter

@foreach (var option in (IDictionary)selectedProduct.Properties) {
} @code { private dynamic selectedProduct = 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; } private void CheckValue() { var data = selectedProduct; } }