1. SitecoreLayoutBindingSource

Class SitecoreLayoutBindingSource

Version: 21.x

Utilities for binding Sitecore layout data.

Namespace: Sitecore.AspNet.RenderingEngine.Binding.Sources
Assembly: Sitecore.AspNet.RenderingEngine.dll
Syntax
public abstract class SitecoreLayoutBindingSource : BindingSource

Constructors

SitecoreLayoutBindingSource(String, String, Boolean, Boolean)

Initializes a new instance of the SitecoreLayoutBindingSource class.

Declaration
protected SitecoreLayoutBindingSource(string id, string displayName, bool isGreedy, bool isFromRequest)
Parameters
TypeNameDescription
System.Stringid

The binding source ID.

System.StringdisplayName

The display name.

System.BooleanisGreedy

A value indicating whether the source is greedy.

System.BooleanisFromRequest

A value indicating whether the data comes from the HTTP request.

Properties

Name

Gets or sets the binding source name.

Declaration
public string Name { get; set; }
Property Value
TypeDescription
System.String

Methods

GetFieldModel<T>(ModelBindingContext, T, Route)

Get the value of an object's field.

Declaration
protected object GetFieldModel<T>(ModelBindingContext bindingContext, T source, Route currentRoute)
    where T : IFieldsReader
Parameters
TypeNameDescription
Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContextbindingContext

The Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext.

Tsource

The source object to process.

RoutecurrentRoute

The route for the current page.

Returns
TypeDescription
System.Object

A field object.

Type Parameters
NameDescription
T

The type of the source object.

GetModel(IServiceProvider, ModelBindingContext, ISitecoreRenderingContext)

Gets the model for binding.

Declaration
public abstract object GetModel(IServiceProvider serviceProvider, ModelBindingContext bindingContext, ISitecoreRenderingContext context)
Parameters
TypeNameDescription
System.IServiceProviderserviceProvider

The System.IServiceProvider.

Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContextbindingContext

The Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext.

ISitecoreRenderingContextcontext

The ISitecoreRenderingContext.

Returns
TypeDescription
System.Object

The bound model.

GetPropertyModel<T>(ModelBindingContext, T)

Gets the value of an object's property.

Declaration
protected object GetPropertyModel<T>(ModelBindingContext bindingContext, T source)
    where T : class
Parameters
TypeNameDescription
Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContextbindingContext

The Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext.

Tsource

The source object to process.

Returns
TypeDescription
System.Object

A property object.

Type Parameters
NameDescription
T

The type of the source object.

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