Class BindingExtensions
Version: 21.x
Extensions to support model binding for Sitecore layout data.
Inheritance
System.Object
BindingExtensions
Namespace: Sitecore.AspNet.RenderingEngine.Binding.Extensions
Assembly: Sitecore.AspNet.RenderingEngine.dll
Syntax
Methods
AddSitecoreModelBinderProviders(MvcOptions)
Adds the default Sitecore model binder providers to the Microsoft.AspNetCore.Mvc.MvcOptions.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Mvc.MvcOptions | options | The Microsoft.AspNetCore.Mvc.MvcOptions to configure. |
GetModelBinder(ModelBinderProviderContext)
Gets the SitecoreLayoutModelBinder
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderProviderContext | context | The Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderProviderContext instance. |
Returns
| Type | Description |
|---|---|
| Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BinderTypeModelBinder | The Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BinderTypeModelBinder instance. |
Type Parameters
| Name | Description |
|---|---|
| TSource | The type of the binding source. |
GetModelBinder<TSource, TType>(ModelBinderProviderContext)
Gets the SitecoreLayoutModelBinder
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderProviderContext | context | The Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderProviderContext instance. |
Returns
| Type | Description |
|---|---|
| Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BinderTypeModelBinder | The Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BinderTypeModelBinder instance. |
Type Parameters
| Name | Description |
|---|---|
| TSource | The type of the binding source. |
| TType | The model type to bind to. |
If you have suggestions for improving this article, let us know!