CollectionModelBinder<TElement> 构造函数

定义

重载

CollectionModelBinder<TElement>(IModelBinder)
已过时.

此构造函数已过时,将在将来的版本中删除。 建议的替代方法是重载,该重载也采用 ILoggerFactory

创建一个新的 CollectionModelBinder<TElement>

CollectionModelBinder<TElement>(IModelBinder, ILoggerFactory)

创建一个新的 CollectionModelBinder<TElement>

CollectionModelBinder<TElement>(IModelBinder, ILoggerFactory, Boolean)

创建一个新的 CollectionModelBinder<TElement>

CollectionModelBinder<TElement>(IModelBinder, ILoggerFactory, Boolean, MvcOptions)

创建一个新的 CollectionModelBinder<TElement>

CollectionModelBinder<TElement>(IModelBinder)

Source:
CollectionModelBinder.cs
Source:
CollectionModelBinder.cs

注意

This constructor is obsolete and will be removed in a future version. The recommended alternative is the overload that also takes an ILoggerFactory.

此构造函数已过时,将在将来的版本中删除。 建议的替代方法是重载,该重载也采用 ILoggerFactory

创建一个新的 CollectionModelBinder<TElement>

public:
 CollectionModelBinder(Microsoft::AspNetCore::Mvc::ModelBinding::IModelBinder ^ elementBinder);
public CollectionModelBinder (Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder elementBinder);
[System.Obsolete("This constructor is obsolete and will be removed in a future version. The recommended alternative is the overload that also takes an ILoggerFactory.")]
public CollectionModelBinder (Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder elementBinder);
new Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<'Element> : Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder -> Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<'Element>
[<System.Obsolete("This constructor is obsolete and will be removed in a future version. The recommended alternative is the overload that also takes an ILoggerFactory.")>]
new Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<'Element> : Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder -> Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<'Element>
Public Sub New (elementBinder As IModelBinder)

参数

elementBinder
IModelBinder

IModelBinder绑定元素的 。

属性

适用于

CollectionModelBinder<TElement>(IModelBinder, ILoggerFactory)

Source:
CollectionModelBinder.cs
Source:
CollectionModelBinder.cs
Source:
CollectionModelBinder.cs

创建一个新的 CollectionModelBinder<TElement>

public:
 CollectionModelBinder(Microsoft::AspNetCore::Mvc::ModelBinding::IModelBinder ^ elementBinder, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory);
public CollectionModelBinder (Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder elementBinder, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory);
new Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<'Element> : Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<'Element>
Public Sub New (elementBinder As IModelBinder, loggerFactory As ILoggerFactory)

参数

elementBinder
IModelBinder

IModelBinder用于绑定 TElement的 。

loggerFactory
ILoggerFactory

ILoggerFactory

注解

即使 IsBindingRequiredtrue,绑定器也不会为未绑定的顶级模型添加错误。

适用于

CollectionModelBinder<TElement>(IModelBinder, ILoggerFactory, Boolean)

Source:
CollectionModelBinder.cs
Source:
CollectionModelBinder.cs

创建一个新的 CollectionModelBinder<TElement>

public:
 CollectionModelBinder(Microsoft::AspNetCore::Mvc::ModelBinding::IModelBinder ^ elementBinder, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory, bool allowValidatingTopLevelNodes);
public CollectionModelBinder (Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder elementBinder, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, bool allowValidatingTopLevelNodes);
new Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<'Element> : Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder * Microsoft.Extensions.Logging.ILoggerFactory * bool -> Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<'Element>
Public Sub New (elementBinder As IModelBinder, loggerFactory As ILoggerFactory, allowValidatingTopLevelNodes As Boolean)

参数

elementBinder
IModelBinder

IModelBinder用于绑定 TElement的 。

loggerFactory
ILoggerFactory

ILoggerFactory

allowValidatingTopLevelNodes
Boolean

指示已启用顶级模型的验证。 如果 trueIsBindingRequiredtrue 适用于顶级模型,则绑定器会在模型未绑定时添加错误 ModelStateDictionary

适用于

CollectionModelBinder<TElement>(IModelBinder, ILoggerFactory, Boolean, MvcOptions)

Source:
CollectionModelBinder.cs

创建一个新的 CollectionModelBinder<TElement>

public:
 CollectionModelBinder(Microsoft::AspNetCore::Mvc::ModelBinding::IModelBinder ^ elementBinder, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory, bool allowValidatingTopLevelNodes, Microsoft::AspNetCore::Mvc::MvcOptions ^ mvcOptions);
public CollectionModelBinder (Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder elementBinder, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, bool allowValidatingTopLevelNodes, Microsoft.AspNetCore.Mvc.MvcOptions mvcOptions);
new Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<'Element> : Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder * Microsoft.Extensions.Logging.ILoggerFactory * bool * Microsoft.AspNetCore.Mvc.MvcOptions -> Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<'Element>
Public Sub New (elementBinder As IModelBinder, loggerFactory As ILoggerFactory, allowValidatingTopLevelNodes As Boolean, mvcOptions As MvcOptions)

参数

elementBinder
IModelBinder

IModelBinder用于绑定 TElement的 。

loggerFactory
ILoggerFactory

ILoggerFactory

allowValidatingTopLevelNodes
Boolean

指示已启用顶级模型的验证。 如果 trueIsBindingRequiredtrue 适用于顶级模型,则绑定器会在模型未绑定时添加错误 ModelStateDictionary

mvcOptions
MvcOptions

MvcOptions

注解

这是首选 CollectionModelBinder<TElement> 构造函数。

适用于