Language

ModelBinder<TModel> Class

Definition

Creates instances of a specified type by binding properties and constructor parameters from command line input.

generic <typename TModel>
public ref class ModelBinder : System::CommandLine::NamingConventionBinder::ModelBinder
public class ModelBinder<TModel> : System.CommandLine.NamingConventionBinder.ModelBinder
type ModelBinder<'Model> = class
    inherit ModelBinder
Public Class ModelBinder(Of TModel)
Inherits ModelBinder

Type Parameters

TModel
Inheritance
ModelBinder<TModel>

Constructors

Name Description
ModelBinder<TModel>()

Initializes a new instance of the Object class.

Properties

Name Description
EnforceExplicitBinding

When set to true, the model binder will only bind constructor parameters or properties that it has been explicitly configured to bind.

(Inherited from ModelBinder)
ModelDescriptor

The descriptor for the model type that the model binder targets.

(Inherited from ModelBinder)
ValueDescriptor

A descriptor for the source value

(Inherited from ModelBinder)

Methods

Name Description
BindMemberFromValue(PropertyInfo, Symbol)

Sets a property using a value descriptor.

(Inherited from ModelBinder)
BindMemberFromValue<TValue>(Expression<Func<TModel,TValue>>, Func<BindingContext,TValue>)

Configures a custom binding behavior for the specified property.

BindMemberFromValue<TValue>(Expression<Func<TModel,TValue>>, Symbol)

Configures a custom binding behavior for the specified property.

CreateInstance(BindingContext)

Creates an instance of the target model type.

(Inherited from ModelBinder)
UpdateInstance<T>(T, BindingContext)

Updates an instance of the target model type.

(Inherited from ModelBinder)

Applies to