Show / Hide Table of Contents

Class BindingExtensions

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
public static class BindingExtensions : Object

Methods

AddSitecoreModelBinderProviders(MvcOptions)

Adds the default Sitecore model binder providers to the Microsoft.AspNetCore.Mvc.MvcOptions.

Declaration
public static void AddSitecoreModelBinderProviders(this MvcOptions options)
Parameters
Type Name Description
Microsoft.AspNetCore.Mvc.MvcOptions options

The Microsoft.AspNetCore.Mvc.MvcOptions to configure.

GetModelBinder<TSource>(ModelBinderProviderContext)

Gets the SitecoreLayoutModelBinder<T> for the specified binding source.

Declaration
public static BinderTypeModelBinder GetModelBinder<TSource>(this ModelBinderProviderContext context)
    where TSource : SitecoreLayoutBindingSource
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<T> for the specified model type and binding source.

Declaration
public static BinderTypeModelBinder GetModelBinder<TSource, TType>(this ModelBinderProviderContext context)
    where TSource : SitecoreLayoutBindingSource
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.

Back to top Generated by DocFX