From 3cd8c8c14dbbe4c51bc40411723ed3ed1a20b5e8 Mon Sep 17 00:00:00 2001 From: jacalvar Date: Thu, 9 Mar 2017 08:08:04 -0800 Subject: [PATCH] [Fixes #5932] Add constructor taking the BinderType to ModelBinderAttribute --- .../ModelBinderAttribute.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/Microsoft.AspNetCore.Mvc.Core/ModelBinderAttribute.cs b/src/Microsoft.AspNetCore.Mvc.Core/ModelBinderAttribute.cs index 461cf0e5ef..c80e2d0fe5 100644 --- a/src/Microsoft.AspNetCore.Mvc.Core/ModelBinderAttribute.cs +++ b/src/Microsoft.AspNetCore.Mvc.Core/ModelBinderAttribute.cs @@ -28,6 +28,26 @@ namespace Microsoft.AspNetCore.Mvc { private BindingSource _bindingSource; + /// + /// Initializes a new instance of . + /// + public ModelBinderAttribute() + { + } + + /// + /// Initializes a new instance of . + /// + /// A which implements . + public ModelBinderAttribute(Type binderType) + { + if (binderType == null) + { + throw new ArgumentNullException(nameof(binderType)); + } + BinderType = binderType; + } + /// public Type BinderType { get; set; }