Skip to content

Commit 0542b87

Browse files
authored
Update ToDictionary overload used by DictionaryModelBinder (#49589)
1 parent 1121b2b commit 0542b87

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Mvc/Mvc.Core/src/ModelBinding/Binders/DictionaryModelBinder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public override async Task BindModelAsync(ModelBindingContext bindingContext)
220220
if (targetType.IsAssignableFrom(typeof(Dictionary<TKey, TValue?>)))
221221
{
222222
// Collection is a List<KeyValuePair<TKey, TValue>>, never already a Dictionary<TKey, TValue>.
223-
return collection.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
223+
return collection.ToDictionary();
224224
}
225225

226226
return base.ConvertToCollectionType(targetType, collection);

0 commit comments

Comments
 (0)