Class SitecoreLayoutModelBinder

Version: 21.x

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

Inheritance

System.Object

SitecoreLayoutModelBinder

Implements

Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder

Namespace: Sitecore.AspNet.RenderingEngine.Binding

Assembly: Sitecore.AspNet.RenderingEngine.dll
Syntax
public class SitecoreLayoutModelBinder<T> : Object where T : SitecoreLayoutBindingSource
Type Parameters
NameDescription
TThe type of the binding source.

Constructors

SitecoreLayoutModelBinder(IServiceProvider, ILogger<SitecoreLayoutModelBinder>)

Initializes a new instance of the SitecoreLayoutModelBinder class.

Declaration
public SitecoreLayoutModelBinder(IServiceProvider serviceProvider, ILogger<SitecoreLayoutModelBinder<T>> logger)
Parameters
TypeNameDescription
System.IServiceProviderserviceProviderThe System.IServiceProvider.
Microsoft.Extensions.Logging.ILogger

<

SitecoreLayoutModelBinder

>
loggerThe Microsoft.Extensions.Logging.ILogger to use for logging.

Methods

BindModelAsync(ModelBindingContext)

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

Implements

Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder

If you have suggestions for improving this article, let us know!