AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

aspnet-core

Build, review, refactor, or architect ASP.NET Core web applications using current official guidance for .NET web development. Use when working on Blazor Web Apps, Razor Pages, MVC, Minimal APIs, controller-based Web APIs, SignalR, gRPC, middleware, dependency injection, configuration, authentication, authorization, testing, performance, deployment, or ASP.NET Core upgrades.

Original source
openai
License
Apache-2.0
Pinned revision
49f948faa9258a0c61caceaf225e179651397431

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

This skill also requires local files or dependencies. Remote reading alone may not be enough.

Ask your assistant

Use Agentic Memory skills to read openai--aspnet-core at revision 49f948faa9258a0c61caceaf225e179651397431, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 15

references/ui-mvc.md

MVC

Primary docs:

  • https://learn.microsoft.com/aspnet/core/mvc/overview
  • https://learn.microsoft.com/aspnet/core/mvc/controllers/
  • https://learn.microsoft.com/aspnet/core/mvc/views/

Choose MVC When Actions And Views Matter

Prefer MVC when the application benefits from explicit controllers, action-based routing, filters, view models, and a strong separation between orchestration and presentation.

This is often the right fit for:

  • large server-rendered sites
  • applications with many cross-cutting filters or action conventions
  • applications that mix views and APIs in the same controller layer
  • teams already organized around controllers and views

Core Shape

Enable MVC with views using:

  • builder.Services.AddControllersWithViews();
  • app.MapControllerRoute(...)

Keep views focused on presentation. Keep controllers focused on HTTP orchestration. Put business rules in services.

Controller Guidance

  • Derive from Controller when the controller returns views
  • Keep actions small and explicit
  • Use model binding and validation instead of manual request parsing
  • Return view models, not EF entities, to views
  • Use POST-Redirect-GET for form submissions

View Guidance

  • Use layouts, partial views, and Tag Helpers to keep markup consistent
  • Keep complex display logic out of Razor markup when it becomes hard to follow
  • Use strongly typed view models
  • Avoid coupling views directly to persistence models

Structure And Scale

  • Use areas for large bounded sections such as Admin or BackOffice
  • Keep route conventions explicit
  • Apply filters when behavior truly belongs at the MVC layer
  • Avoid giant god controllers; split by cohesive feature or resource

Choosing MVC Over Razor Pages

Prefer MVC over Razor Pages when:

  • multiple related actions share controller-level behavior
  • handler-level authorization or action filters matter
  • URL and action design are more natural than page-file routing