Model binding
If you integrated your app before , it's using the legacy ASP.NET Core Rendering SDK, version 22 or earlier. This SDK is no longer receiving updates, so we recommend that you upgrade to the latest version of the new .
The Sitecore Rendering Engine provides ASP.NET model binding support for key objects, properties, and fields returned by the Layout Service in a SitecoreLayoutResponse object.
Model binding is done with IFieldReader and is case-sensitive. If a model property is not mapped through attributes, default ASP.NET Model-View-Controller model binding behavior takes over.
The attributes, sources, providers, and so on are located in the Sitecore.AspNet.RenderingEngine.Binding namespace of the Rendering Engine libraries.
Model properties that implement IField do not require explicit attributes and bind to the current component or the current route field of the same name.
The current component, response, or route refers to the corresponding objects in the SitecoreLayoutResponse instance that are available as context information on the HttpContext object. For a given request, the current response and route are the same for all components, but the placeholder tag helper sets the current component dynamically.
An example Layout Service response:
A matching view model class:
For an example of a context extension, see Extending Context Data Returned by the Layout Service.