public static dynamic MakeExpandoWithDefaults(IEnumerable <Tuple <string, Type> > props) { IDictionary <string, object> obj = new ExpandoObject() as IDictionary <string, object>; foreach (var prop in props) { obj.Add(prop.Item1, PropMold.GetDefault(prop.Item2)); } return(obj); }
public static PropMold Make <T>(string name, T defaultValue) { PropMold result = new PropMold() { Name = name, Type = typeof(T), DefaultValue = defaultValue }; return(result); }