ModelBindingContext.EnterNestedScope Method

Definition

Overloads

EnterNestedScope()

Pushes a layer of state onto this context. IModelBinder implementations will call this as part of recursion when binding properties or collection items.

EnterNestedScope(ModelMetadata, String, String, Object)

Pushes a layer of state onto this context. IModelBinder implementations will call this as part of recursion when binding properties or collection items.

EnterNestedScope()

Source:
ModelBindingContext.cs
Source:
ModelBindingContext.cs
Source:
ModelBindingContext.cs

Pushes a layer of state onto this context. IModelBinder implementations will call this as part of recursion when binding properties or collection items.

C#
public abstract Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext.NestedScope EnterNestedScope ();

Returns

A ModelBindingContext.NestedScope scope object which should be used in a using statement where EnterNestedScope() is called.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

EnterNestedScope(ModelMetadata, String, String, Object)

Source:
ModelBindingContext.cs
Source:
ModelBindingContext.cs
Source:
ModelBindingContext.cs

Pushes a layer of state onto this context. IModelBinder implementations will call this as part of recursion when binding properties or collection items.

C#
public abstract Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext.NestedScope EnterNestedScope (Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata modelMetadata, string fieldName, string modelName, object model);
C#
public abstract Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext.NestedScope EnterNestedScope (Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata modelMetadata, string fieldName, string modelName, object? model);

Parameters

modelMetadata
ModelMetadata

ModelMetadata to assign to the ModelMetadata property.

fieldName
String

Name to assign to the FieldName property.

modelName
String

Name to assign to the ModelName property.

model
Object

Instance to assign to the Model property.

Returns

A ModelBindingContext.NestedScope scope object which should be used in a using statement where EnterNestedScope(ModelMetadata, String, String, Object) is called.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0