# System.Web.Mvc

**Kind:** Service

**Source:** `Pams/Core/Pams.Security/Pams.Security.csproj` (line 1)

**Part of:** [Pams](subsystem-pams)

NuGet package dependency

`System.Web.Mvc` is a NuGet package dependency declared by `Pams.Security.csproj`. It supplies ASP.NET MVC types that Pams.Security can reference when participating in legacy MVC request handling, controller actions, and authorization flows.

## Diagram

```mermaid
sequenceDiagram
    participant Client
    participant Mvc as System.Web.Mvc
    participant Security as Pams.Security

    Client->>Mvc: Send MVC request
    Mvc->>Security: Invoke security integration
    Security-->>Mvc: Return authorization result
    Mvc-->>Client: Return MVC response
```

## Usage

```typescript
async function loadProtectedResource() {
  const response = await fetch("/security/protected-resource", {
    credentials: "include",
  });

  if (!response.ok) {
    throw new Error("The MVC security endpoint rejected the request.");
  }

  return response.json();
}

loadProtectedResource().then((resource) => {
  console.log(resource);
});
```

## AI Coding Instructions

- Keep `System.Web.Mvc` references limited to code that integrates with the legacy ASP.NET MVC pipeline.
- Add MVC dependencies through `Pams.Security.csproj` rather than copying MVC assemblies into the project.
- Treat MVC controllers, filters, and authorization results as integration points between request handling and Pams.Security.
- Do not introduce ASP.NET Core MVC types into code that depends on `System.Web.Mvc`; the namespaces and pipeline models differ.
