# System.Data

**Kind:** Service

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

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

NuGet package dependency

System.Data is a NuGet package dependency declared by `Pams/Logic/Common/Pams.Common.csproj`. It makes `System.Data` APIs available to the common Pams project for code that works with tabular data and database-related types.

## Diagram

```mermaid
sequenceDiagram
    participant Developer
    participant Build as Build Process
    participant NuGet
    participant Common as Pams.Common
    participant Provider as Data Provider

    Developer->>Build: Restore and build project
    Build->>NuGet: Resolve System.Data package
    NuGet-->>Build: Return package assemblies
    Build->>Common: Compile with System.Data reference
    Common->>Provider: Exchange data through System.Data types
```

## Usage

```ts
import { execFileSync } from "node:child_process";

const project = "Pams/Logic/Common/Pams.Common.csproj";

// Restore NuGet dependencies, including System.Data.
execFileSync("dotnet", ["restore", project], {
  stdio: "inherit",
});

// Build the project after dependencies have been restored.
execFileSync("dotnet", ["build", project, "--no-restore"], {
  stdio: "inherit",
});
```

## AI Coding Instructions

- Keep the `System.Data` package reference in `Pams.Common.csproj` when code depends on `System.Data` namespaces.
- Restore NuGet packages before building projects that reference `Pams.Common`.
- Use `System.Data` types at project boundaries where database providers or tabular results are exchanged.
- Check target framework compatibility before changing the package reference or migrating the project format.
