The AdventureWorksMVC solution is a single-project ASP.NET MVC 4 application targeting .NET Framework 4.5. Understanding where each piece lives is the first step to working confidently in the codebase — the layout follows classic Visual Studio conventions with one notable departure: all Entity Framework model files and hand-written business logic share the sameDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/aws-samples/legacy-cycle-store-mvc-app/llms.txt
Use this file to discover all available pages before exploring further.
Business/ directory rather than being split into a separate class library.
Directory Tree
App_Start
TheApp_Start/ directory holds the three static configuration classes that Global.asax.cs calls during application startup. None of these classes contain instance state — they are purely registration helpers.
FilterConfig.cs
Registers
HandleErrorAttribute as a global MVC filter so unhandled exceptions render the Error view rather than a raw ASP.NET yellow screen.RouteConfig.cs
Defines the single conventional route
{controller}/{action}/{id} with defaults of Home / Default. All page URLs resolve through this one entry.WebApiConfig.cs
Registers the Web API route prefix
api/{controller}/{id}. No API controllers exist in the current codebase, but the scaffold is wired up for future use.Business
TheBusiness/ directory is the heart of the application’s data access and domain logic. It contains two distinct concerns bundled together.
Placing both the Entity Framework EDMX model and the hand-written manager classes in the same
Business/ directory is a common pattern in legacy ASP.NET projects. It avoids the overhead of a separate class library while still keeping data-access code out of the controllers. When migrating to a modern architecture, these two concerns should be split: the EF model moves to a dedicated data project and the manager classes evolve into proper service or repository classes.EF Model Files
| File | Purpose |
|---|---|
CycleModel.edmx | The design-time XML model. Open this in Visual Studio’s EDMX designer to view and edit the entity diagram. |
CycleModel.tt | T4 template that reads the EDMX and generates the entity classes (Product.cs, ProductCategory.cs, ProductSubcategory.cs). Runs automatically when the EDMX is saved. |
CycleModel.Context.tt | Companion T4 template that generates CycleModel.Context.cs, which contains the CYCLE_STOREEntities DbContext class. |
CycleModel.cs / CycleModel.Designer.cs | Legacy EF4-style designer output. Largely superseded by the .tt-generated files but still present in the project. |
Business Logic Files
| File | Purpose |
|---|---|
Common.cs | Exposes a static DataEntities property that constructs a fresh CYCLE_STOREEntities instance on each access. |
CategoryManager.cs | Static query methods for ProductCategory and ProductSubcategory lookups. |
ProductManager.cs | Static query methods for Product lookups, plus attribute-list helpers (colors, sizes, weights). |
Controllers
TheControllers/ directory follows standard MVC conventions. Each controller file contains a single class that inherits from System.Web.Mvc.Controller.
| Controller | Responsibility |
|---|---|
HomeController.cs | Renders the homepage (Default action). |
SiteLayoutController.cs | Provides three child-action endpoints — HeaderLayout, FooterLayout, and ContentLayout — that the Razor layout calls via Html.RenderAction. |
ErrorController.cs | Catches routed error requests (404, 500) and renders the Error/Default view. |
Models
TheModels/ directory holds the single view model used by the site layout system.
| File | Purpose |
|---|---|
SiteLayoutModel.cs | Carries navigation categories, auth visibility flags, and shopping cart state to the layout child-action views. |
Views
Views are organised by controller name underViews/, with Shared/ holding the master layout.
View hierarchy
View hierarchy
Shared/_SiteLayout.cshtml— the root Razor layout. Sets the<html>structure, links the stylesheet, and callsHtml.RenderAction("HeaderLayout", "SiteLayout")before yielding@RenderBody().Home/Default.cshtml— the homepage view. Its body callsHtml.RenderAction("ContentLayout", "SiteLayout")to render the category navigation panel.SiteLayout/HeaderLayout.cshtml— renders the logo and “Unicorn Bike Rentals” banner.SiteLayout/ContentLayout.cshtml— iteratesModel.ProductCategoriesand their nested subcategories to build the navigation sidebar.Error/Default.cshtml— generic error page rendered byErrorControlleror theHandleErrorAttributefilter.
Helpers, Images, css, and favicon
These directories hold static front-end resources and one small utility class.| Path | Contents |
|---|---|
Helpers/WebResource.cs | Utility helper for resolving URLs to static resources within the application. |
Images/logo.png | The store logo displayed in the header layout. |
css/StyleSheet.css | The single site-wide stylesheet. |
favicon/ | Multiple pre-sized favicon images (favicon-16x16.png, favicon-32x32.png, etc.) for broad browser and device support. |
Configuration Files
Web.config Transform Chain
The project uses the standard Visual Studio config transform system. There are three files:Web.config holds the base connection string for CYCLE_STOREEntities, AppSettings, and the system.web / system.webServer sections. Web.Release.config typically replaces the connection string with the production database and enables custom errors. Web.Debug.config leaves most settings at their development defaults.
Global.asax.cs
Global.asax.cs is the application entry point. The Application_Start method calls the three App_Start registration helpers in order: