public object InitializeFromDictionary(Type objectType, IDictionary<string, object> values) { ValueProvider dictionaryProvider = new DictionaryValueProvider(values); ModelBinder binder = new FastModelBinder(); ModelBinderContext context = new InitializerModelBinderContext(dictionaryProvider); object obj = binder.Bind(objectType, context); return obj; }
public object InitializeFromDictionary(Type objectType, IDictionary <string, object> values) { ValueProvider dictionaryProvider = new DictionaryValueProvider(values); ModelBinder binder = new FastModelBinder(); ModelBinderContext context = new InitializerModelBinderContext(dictionaryProvider); object obj = binder.Bind(objectType, context); return(obj); }