# Microsoft.Owin

**Kind:** Service

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

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

NuGet package dependency

`Microsoft.Owin` is a NuGet package dependency declared in the legacy-format `Pams.Business` project file. It supplies OWIN abstractions used to connect application middleware with the HTTP request pipeline.

## Diagram

```mermaid
sequenceDiagram
    participant Client
    participant OwinHost as OWIN Host
    participant Middleware
    participant PamsBusiness as Pams.Business

    Client->>OwinHost: HTTP request
    OwinHost->>Middleware: Create OWIN environment
    Middleware->>PamsBusiness: Invoke application logic
    PamsBusiness-->>Middleware: Response data
    Middleware-->>OwinHost: HTTP response
    OwinHost-->>Client: HTTP response
```

## Usage

```typescript
async function getPamsData() {
  const response = await fetch("/api/pams");

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

  return response.json();
}

getPamsData()
  .then((data) => console.log(data))
  .catch((error) => console.error(error));
```

## AI Coding Instructions

- Keep `Microsoft.Owin` package references in the legacy `Pams.Business.csproj` format unless the project file is migrated.
- Configure OWIN middleware in the application startup path, not inside business-layer request handlers.
- Treat OWIN environment data as request-scoped and avoid storing it in static state.
- Confirm that endpoint routes called by JavaScript clients are registered in the OWIN host pipeline.

## 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
