Class SitecoreLayoutBindingSource

Version: 21.x

Utilities for binding Sitecore layout data.

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

Constructors

SitecoreLayoutBindingSource(String, String, Boolean, Boolean)

Initializes a new instance of the SitecoreLayoutBindingSource class.

Declaration
RequestResponse
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
RequestResponse
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
RequestResponse
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
RequestResponse
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
RequestResponse
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.

Do you have some feedback for us?

If you have suggestions for improving this article,