Class SitecoreLayoutModelBinder<T>

Version: 21.x

Implements model binding for Sitecore layout data specified by the SitecoreLayoutBindingSource.

Inheritance
System.Object
SitecoreLayoutModelBinder<T>
Implements
Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder
Namespace: Sitecore.AspNet.RenderingEngine.Binding
Assembly: Sitecore.AspNet.RenderingEngine.dll
Syntax
RequestResponse
public class SitecoreLayoutModelBinder<T> : Object where T : SitecoreLayoutBindingSource
Type Parameters
NameDescription
T

The type of the binding source.

Constructors

SitecoreLayoutModelBinder(IServiceProvider, ILogger<SitecoreLayoutModelBinder<T>>)

Initializes a new instance of the SitecoreLayoutModelBinder<T> class.

Declaration
RequestResponse
public SitecoreLayoutModelBinder(IServiceProvider serviceProvider, ILogger<SitecoreLayoutModelBinder<T>> logger)
Parameters
TypeNameDescription
System.IServiceProviderserviceProvider

The System.IServiceProvider.

Microsoft.Extensions.Logging.ILogger<SitecoreLayoutModelBinder<T>>logger

The Microsoft.Extensions.Logging.ILogger to use for logging.

Methods

BindModelAsync(ModelBindingContext)

Declaration
RequestResponse
public Task BindModelAsync(ModelBindingContext bindingContext)
Parameters
TypeNameDescription
Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContextbindingContext
Returns
TypeDescription
System.Threading.Tasks.Task

Implements

Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder

Do you have some feedback for us?

If you have suggestions for improving this article,