DictionaryModelBinder<TKey,TValue> 类  
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
IModelBinder 绑定字典值的实现。
generic <typename TKey, typename TValue>
public ref class DictionaryModelBinder : Microsoft::AspNetCore::Mvc::ModelBinding::Binders::CollectionModelBinder<System::Collections::Generic::KeyValuePair<TKey, TValue>>public class DictionaryModelBinder<TKey,TValue> : Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<System.Collections.Generic.KeyValuePair<TKey,TValue>>type DictionaryModelBinder<'Key, 'Value> = class
    inherit CollectionModelBinder<KeyValuePair<'Key, 'Value>>Public Class DictionaryModelBinder(Of TKey, TValue)
Inherits CollectionModelBinder(Of KeyValuePair(Of TKey, TValue))类型参数
- TKey
字典中键的类型。
- TValue
字典中值的类型。
- 继承
构造函数
属性
| ElementBinder | 获取 IModelBinder 绑定集合元素的实例。(继承自 CollectionModelBinder<TElement>) | 
| Logger | ILogger用于在此绑定器中记录的 。(继承自 CollectionModelBinder<TElement>) | 
方法
| AddErrorIfBindingRequired(ModelBindingContext) | 如果 IsBindingRequired为 ,ModelError则向 ModelState 添加 。(继承自 CollectionModelBinder<TElement>) | 
| BindModelAsync(ModelBindingContext) | 尝试绑定模型。 | 
| CanCreateInstance(Type) | 获取指示此 ICollectionModelBinder 实现是否可以创建 Object 可分配给 的  | 
| ConvertToCollectionType(Type, IEnumerable<KeyValuePair<TKey,TValue>>) | IModelBinder 绑定字典值的实现。 | 
| ConvertToCollectionType(Type, IEnumerable<TElement>) | 获取一个 Object 可  | 
| CopyToModel(Object, IEnumerable<TElement>) | 将 中的  | 
| CreateEmptyCollection(Type) | 创建 Object 可分配给 的  | 
| CreateInstance(Type) | 创建  |