---
title: "ASP.NET Core SDK architecture"
slug: "asp-net-core-sdk-architecture"
abstract: "Understand the architecture of the ASP.NET Core SDK and how data flows between the web browser, your ASP.NET Core app, and SitecoreAI."
---
# ASP.NET Core SDK architecture

The Sitecore ASP.NET Core SDK architecture follows the ASP.NET Core framework and standard conventions for the HTTP request-response cycle.

## Basic data flow

Here's a brief overview of how data flows between the web browser, the ASP.NET Core app, and SitecoreAI:

1. When a site visitor visits the ASP.NET Core front-end web app[^UUID-6d3bdb56-068f-19ce-e490-be85536320d3_N66c6f8d0d2b9c] in their web browser, the app receives an HTTP request.
2. The SDK, installed in the ASP.NET Core app, makes a GraphQL[^UUID-6d3bdb56-068f-19ce-e490-be85536320d3_N66c6f9af33a43] API request to Sitecore Experience Edge[^UUID-6d3bdb56-068f-19ce-e490-be85536320d3_N66c87126a7364] to retrieve JSON-formatted layout data[^UUID-6d3bdb56-068f-19ce-e490-be85536320d3_N66c5d012f23a5] from SitecoreAI.
3. The ASP.NET Core app renders the layout data to the site visitor.

Here's a basic diagram showing this data flow:

![A basic diagram showing the data flow between the web browser, the ASP.NET Core app, and SitecoreAI.](https://doc.sitecore.com/api/markdown-image/sai/en/developers/asp-net/0/asp-net-core-sdk/image/aspnet-core-sdk-http-request-response-cycle-basic-diagram.jpg)

## Complete data flow

Here's a detailed explanation of the complete data flow between the web browser, the ASP.NET Core app, and SitecoreAI:

1. The ASP.NET Core app receives an incoming HTTP request.
2. The ASP.NET Core SDK maps the URL of the HTTP request to a controller action with the `[UseSitecoreRendering]` attribute.

    The ASP.NET Core SDK follows the standard ASP.NET Core process of [routing to controller actions](https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing).

3. The `UseSitecoreRendering` attribute triggers the Sitecore Rendering Engine middleware. The controller action does not run yet.
4. The Rendering Engine Middleware makes a GraphQL API request to Experience Edge, using data from the HTTP request.

    Example: if the requested URL is `https://<hostname>/products`, the middleware makes a request to Experience Edge for an item in SitecoreAI at the `/products` path.

5. Experience Edge sends the response to the Rendering Engine Middleware.
6. The Rendering Engine Middleware deserializes the response into a rendering context and runs the controller action to render the view.
7. The controller action starts rendering the view using the data in the response.

    In this step, the ASP.NET Core app uses [Sitecore tag helpers](https://doc.sitecore.com/sai/en/developers/asp-net/0/asp-net-core-sdk/tag-helpers.html "Tag helpers"), such as `<sc-placeholder/>`, to resolve the components that come from Experience Edge into [model-bound views](https://doc.sitecore.com/sai/en/developers/asp-net/0/asp-net-core-sdk/model-bound-views.html "Model-bound views"), [view components](https://doc.sitecore.com/sai/en/developers/asp-net/0/asp-net-core-sdk/view-components.html "View components"), and [partial views](https://doc.sitecore.com/sai/en/developers/asp-net/0/asp-net-core-sdk/partial-views.html "Partial views").

8. After the entire component tree is rendered, the final HTTP response is created.
9. The ASP.NET Core app renders the layout data to the site visitor.

Here's a complete diagram, showing all the details of the data flow, including how the layout data is used to render a page in the app:

![A full diagram showing all the details of the data flow between the web browser, the ASP.NET Core app, and SitecoreAI.](https://doc.sitecore.com/api/markdown-image/sai/en/developers/asp-net/0/asp-net-core-sdk/image/aspnet-core-sdk-http-request-response-cycle-full-diagram.jpg)

[^UUID-6d3bdb56-068f-19ce-e490-be85536320d3_N66c6f8d0d2b9c]: A *front-end web app*, previously known as a rendering host or rendering app, is a web-based application that displays content to site visitors. The content, or layout data, is retrieved from SitecoreAI that the app connects to using a Sitecore SDK, such as the ASP.NET Core SDK.
    
    The front-end web app does more than just render content: it also handles user requests, routing, data fetching, and other Sitecore digital experience platform (DXP) capabilities.

[^UUID-6d3bdb56-068f-19ce-e490-be85536320d3_N66c6f9af33a43]: *GraphQL* is a query language for APIs and a runtime for fulfilling those queries with existing data. The Sitecore ASP.NET Core SDK uses GraphQL to retrieve layout data from SitecoreAI.

[^UUID-6d3bdb56-068f-19ce-e490-be85536320d3_N66c87126a7364]: *Experience Edge* is a service where SitecoreAI content, such as webpages, site layout, navigation, and other elements, are published. Experience Edge delivers this content to various channels, such as web apps, mobile apps, airport check-in kiosks, email, SMS, wearables, AI-enabled voice assistants, VR headsets, IoT devices, and more.

[^UUID-6d3bdb56-068f-19ce-e490-be85536320d3_N66c5d012f23a5]: *Layout data* is a JSON object that represents the structure of a page or a component in Sitecore. The layout data is used to display the page in a front-end application. The ASP.NET Core SDK uses GraphQL to retrieve layout data.
