public Dictionary <string, List <string> > BuildDict() { var dict = new Dictionary <string, List <string> >(); Subs? .OfTypeRecur <Input>() .Where(i => !string.IsNullOrEmpty(i.Name?.ToString()) && !string.IsNullOrEmpty(i.Value?.ToString())) .ForEach(i => dict[i.Name.ToString()] = new[] { i.Value.ToString() }.ToList()); Subs? .OfTypeRecur <Select>() .Where(i => !string.IsNullOrEmpty(i.Name?.ToString())) .Select(s => new { name = s.Name, value = string.Join(",", s.Subs.OfTypeRecur <Option>().Where(o => o.Selected).Select(o => o.Value).ToArray()) }) .ForEach(i => dict[i.name.ToString()] = new[] { i.value.ToString() }.ToList()); if (Disabled) { dict[nameof(Disabled)] = new[] { "true" } }