# System.Web.Razor

**Kind:** Service

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

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

NuGet package dependency

`System.Web.Razor` is a NuGet package reference in the legacy `Pams.Business` project. It supports Razor parsing and rendering for server-side ASP.NET views or templates used by the PAMS application.

## Diagram

```mermaid
sequenceDiagram
    participant Client as JavaScript Client
    participant App as ASP.NET Application
    participant Business as Pams.Business
    participant Razor as System.Web.Razor

    Client->>App: Request Razor-backed page
    App->>Business: Run business logic
    Business->>Razor: Compile and render Razor template
    Razor-->>App: Rendered HTML
    App-->>Client: HTML response
```

## Usage

```ts
// System.Web.Razor runs on the ASP.NET server.
// Client code requests a page rendered by the application.

async function loadPamsView() {
  const response = await fetch("/pams/view", {
    headers: {
      Accept: "text/html",
    },
  });

  if (!response.ok) {
    throw new Error("Unable to load the PAMS view.");
  }

  const html = await response.text();
  document.querySelector("#pams-content")!.innerHTML = html;
}

loadPamsView();
```

## AI Coding Instructions

- Treat `System.Web.Razor` as a legacy NuGet dependency referenced by `Pams.Business`, not as a JavaScript package.
- Keep Razor rendering inside the ASP.NET application boundary; browser code should request rendered HTML or API data.
- Check the project file before changing the package reference or version, because legacy package configuration may affect other ASP.NET dependencies.
- Avoid adding modern Razor SDK assumptions unless the project is migrated from its current legacy project format.

## Used by

4 references from 4 files. 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 (4)

- `Pams.API` — `Pams/API/Pams.API/Pams.API.csproj`:1
- `Pams.Core` — `Pams/Core/Pams.Core/Pams.Core.csproj`:1
- `Pams.Security` — `Pams/Core/Pams.Security/Pams.Security.csproj`:1
- `Pams.Business` — `Pams/Logic/Pams.Business/Pams.Business.csproj`:1
