# Microsoft.AspNetCore.Mvc

**Kind:** Service

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

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

NuGet package dependency

`Microsoft.AspNetCore.Mvc` is a NuGet package dependency referenced by the web project. It supplies ASP.NET Core MVC types for defining controllers, routing HTTP requests, model binding, and returning HTTP responses.

## Diagram

```mermaid
flowchart TD
    Client[JavaScript client] -->|HTTP request| Controller[ASP.NET Core MVC controller]
    Controller -->|model binding| Action[Controller action]
    Action -->|HTTP response| Client
```

## Usage

```ts
const response = await fetch("/api/patients", {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    name: "Example Patient"
  })
});

if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}

const patient = await response.json();
console.log(patient);
```

## AI Coding Instructions

- Define HTTP endpoints in ASP.NET Core controllers that inherit from `ControllerBase` or `Controller`.
- Use attribute routing such as `[Route]`, `[HttpGet]`, and `[HttpPost]` to map controller actions.
- Return MVC action results such as `Ok`, `Created`, `BadRequest`, and `NotFound` from controller actions.
- Keep JavaScript clients aligned with controller route paths, HTTP methods, request bodies, and response formats.

## Used by

1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

### Injected or called by (1)

- `Pams.Web` — `Pams/Web/Pams.Web/Pams.Web.csproj`:1
