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 : SitecoreLayoutBindingSourceType Parameters
| Name | Description |
|---|---|
| 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
| Type | Name | Description |
|---|---|---|
| System.IServiceProvider | serviceProvider |
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
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext | bindingContext |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
Implements
Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder