# System.Runtime.Serialization

**Kind:** Service

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

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

NuGet package dependency

`System.Runtime.Serialization` is a NuGet package dependency referenced by `Pams.Business`. It supports serialization contracts and legacy-format data handling within business-layer code that exchanges serialized payloads with other system components.

## Diagram

```mermaid
flowchart TD
    Client[JavaScript Client] -->|JSON request| Api[Application API]
    Api --> Business[Pams.Business]
    Business --> Serialization[System.Runtime.Serialization]
    Serialization --> Payload[Serialized Contract]
    Payload --> Api
    Api -->|JSON response| Client
```

## Usage

```ts
type SerializedRecord = {
  id: string;
  status: string;
};

async function loadRecord(id: string): Promise<SerializedRecord> {
  const response = await fetch(`/api/records/${encodeURIComponent(id)}`);

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

  return response.json();
}

const record = await loadRecord("record-id");
console.log(record.status);
```

## AI Coding Instructions

- Treat `System.Runtime.Serialization` as a package dependency of `Pams.Business`, not as a JavaScript runtime package.
- Keep serialized contract names and field shapes compatible with existing business-layer models.
- Check for legacy-format serialization attributes before changing model properties or constructors.
- Update the project dependency configuration when adding code that requires serialization APIs.

## Used by

2 references from 2 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 (2)

- `Pams.Data` — `Pams/Data/Pams.Data/Pams.Data.csproj`:1
- `Pams.Business` — `Pams/Logic/Pams.Business/Pams.Business.csproj`:1
