Share via


CollectionModelBinder<TElement> Constructors

Definition

Overloads

CollectionModelBinder<TElement>(IModelBinder)

Source:
CollectionModelBinder.cs
Source:
CollectionModelBinder.cs

Caution

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

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

Creates a new CollectionModelBinder<TElement>.

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);

Parameters

elementBinder
IModelBinder

The IModelBinder for binding elements.

Attributes

Applies to

CollectionModelBinder<TElement>(IModelBinder, ILoggerFactory)

Source:
CollectionModelBinder.cs
Source:
CollectionModelBinder.cs
Source:
CollectionModelBinder.cs
public CollectionModelBinder (Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder elementBinder, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory);

Parameters

elementBinder
IModelBinder

The IModelBinder for binding TElement.

loggerFactory
ILoggerFactory

The ILoggerFactory.

Remarks

The binder will not add an error for an unbound top-level model even if IsBindingRequired is true.

Applies to

CollectionModelBinder<TElement>(IModelBinder, ILoggerFactory, Boolean)

Source:
CollectionModelBinder.cs
Source:
CollectionModelBinder.cs
public CollectionModelBinder (Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder elementBinder, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, bool allowValidatingTopLevelNodes);

Parameters

elementBinder
IModelBinder

The IModelBinder for binding TElement.

loggerFactory
ILoggerFactory

The ILoggerFactory.

allowValidatingTopLevelNodes
Boolean

Indication that validation of top-level models is enabled. If true and IsBindingRequired is true for a top-level model, the binder adds a ModelStateDictionary error when the model is not bound.

Applies to

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

Source:
CollectionModelBinder.cs
public CollectionModelBinder (Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder elementBinder, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, bool allowValidatingTopLevelNodes, Microsoft.AspNetCore.Mvc.MvcOptions mvcOptions);

Parameters

elementBinder
IModelBinder

The IModelBinder for binding TElement.

loggerFactory
ILoggerFactory

The ILoggerFactory.

allowValidatingTopLevelNodes
Boolean

Indication that validation of top-level models is enabled. If true and IsBindingRequired is true for a top-level model, the binder adds a ModelStateDictionary error when the model is not bound.

mvcOptions
MvcOptions

The MvcOptions.

Remarks

This is the preferred CollectionModelBinder<TElement> constructor.

Applies to