// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.Linq;
namespace Microsoft.AspNet.Mvc.ModelBinding
{
///
/// implementation for binding dictionary values.
///
/// Type of keys in the dictionary.
/// Type of values in the dictionary.
public class DictionaryModelBinder : CollectionModelBinder>
{
///
protected override object GetModel(IEnumerable> newCollection)
{
return newCollection?.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
}
}
}