[Fixes #5932] Add constructor taking the BinderType to ModelBinderAttribute
This commit is contained in:
parent
015dafc25f
commit
3cd8c8c14d
|
|
@ -28,6 +28,26 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
{
|
{
|
||||||
private BindingSource _bindingSource;
|
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 />
|
/// <inheritdoc />
|
||||||
public Type BinderType { get; set; }
|
public Type BinderType { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue