[Fixes #5932] Add constructor taking the BinderType to ModelBinderAttribute

This commit is contained in:
jacalvar 2017-03-09 08:08:04 -08:00
parent 015dafc25f
commit 3cd8c8c14d
1 changed files with 20 additions and 0 deletions

View File

@ -28,6 +28,26 @@ namespace Microsoft.AspNetCore.Mvc
{
private BindingSource _bindingSource;
/// <summary>
/// Initializes a new instance of <see cref="ModelBinderAttribute"/>.
/// </summary>
public ModelBinderAttribute()
{
}
/// <summary>
/// Initializes a new instance of <see cref="ModelBinderAttribute"/>.
/// </summary>
/// <param name="binderType">A <see cref="Type"/> which implements <see cref="IModelBinder"/>.</param>
public ModelBinderAttribute(Type binderType)
{
if (binderType == null)
{
throw new ArgumentNullException(nameof(binderType));
}
BinderType = binderType;
}
/// <inheritdoc />
public Type BinderType { get; set; }