# Framework.NCore

Mono-repo for the SAIF .NET Core Framework — the shared class-library layer used by SAIF applications for authentication, logging, data access, messaging, HTTP clients, and related cross-cutting concerns.

This repository consolidates 19 previously-separate repositories (`Framework.NCore.<Component>`) into a single repository, one folder per component under `src/`, each still built, versioned, and published as its **own independent NuGet package** by its **own independent pipeline**. Moving to a mono-repo simplifies discovery, cross-component code review, and dependency-graph visibility, without changing the packaging model: applications continue to reference only the specific SAIF NuGet packages they need.

## Repository layout

```
.azdo/{component}/       Azure Pipelines YAML + variables for each component's build/pack/publish pipeline
src/{component}/         Source for each component (solution, projects, tests)
docs/                    Generated documentation (see docs/index.md)
Architecture.md          Framework architecture, dependency layers, and Mermaid diagram
Pipelines.md             Current Azure DevOps pipeline definitions for every component
LegacyRepositories.md    Links to the retired, read-only standalone repos this repo replaced
UpdateFlow.md            Step-by-step procedure for propagating a change up through the package layers
packages.md              NuGet package catalog and included libraries
README.md                This file
```

`{component}` is the same folder name used historically for each library (e.g. `SAIF.NetCore.AuthService`, `Messaging`, `SAIF.NetCore.Clients.UC4`) — see [`Architecture.md`](./Architecture.md) for the full component list and how they map to NuGet package names.

## Where to look next

- **[`Architecture.md`](./Architecture.md)** — describes the framework's layered architecture (foundation → implementation libraries → `ServiceExtensions` → applications), the NuGet dependency rules between components, and a Mermaid diagram of the overall shape.
- **[`Pipelines.md`](./Pipelines.md)** — documents every component's Azure DevOps build/pack/publish pipeline: pipeline name/link, YAML path, published package, trigger, and agent pool.
- **[`LegacyRepositories.md`](./LegacyRepositories.md)** — links to the 19 standalone repositories this repo replaced, kept read-only for history.
- **[`UpdateFlow.md`](./UpdateFlow.md)** — the required, ordered procedure (contracts → implementation → `ServiceExtensions`) for propagating a change through the NuGet package graph, with a Mermaid flow diagram. Follow this for any cross-layer upgrade, whether done by a human or an AI agent.
- **[`packages.md`](packages.md)** — the NuGet package catalog and included libraries.
- **[`docs/index.md`](docs/index.md)** — full generated documentation for every library.

## Contributing

- Each component only takes NuGet package dependencies on other SAIF components (never direct project references), so components can still be changed and released independently within this shared repository.
- Pushes to `main` are path-scoped per component (`src/{component}/**`), so a change to one component only triggers that component's pipeline.
- The `main` branch is protected: pull requests require at least one reviewer, with automatic (non-blocking) review requests sent to the Technology Architect, Technology Architecture Mgr, and Site Reliability Engineer II groups.

---

## Generated libraries

| Library | Purpose | Index | Documentation |
| --- | --- | --- | --- |
| SAIF.NetCore.ServiceContracts | Defines shared contracts, data types, and exceptions used across the framework. | [Index](docs/libraries/saif-netcore-servicecontracts/index.md) | [Documentation](docs/libraries/saif-netcore-servicecontracts/overview.md) |
| SAIF.NetCore.Common | Provides reusable extensions, helpers, shared value types, and exceptions. | [Index](docs/libraries/saif-netcore-common/index.md) | [Documentation](docs/libraries/saif-netcore-common/overview.md) |
| SAIF.NetCore.AuthService | Implements identity services, role authorization, Security API clients, and token clients. | [Index](docs/libraries/saif-netcore-authservice/index.md) | [Documentation](docs/libraries/saif-netcore-authservice/overview.md) |
| SAIF.NetCore.HashUtil | Provides hash salting and recovery utilities with creation-date information. | [Index](docs/libraries/saif-netcore-hashutil/index.md) | [Documentation](docs/libraries/saif-netcore-hashutil/overview.md) |
| SAIF.NetCore.Logging | Implements host-specific logging services and delivery to the SAIF Logging API. | [Index](docs/libraries/saif-netcore-logging/index.md) | [Documentation](docs/libraries/saif-netcore-logging/overview.md) |
| SAIF.NetCore.PingableService | Provides a `/Ping` health endpoint and service health-check contracts. | [Index](docs/libraries/saif-netcore-pingableservice/index.md) | [Documentation](docs/libraries/saif-netcore-pingableservice/overview.md) |
| SAIF.NetCore.DBConnectionClient | Retrieves and caches database connection strings through the DBConnection API. | [Index](docs/libraries/saif-netcore-dbconnectionclient/index.md) | [Documentation](docs/libraries/saif-netcore-dbconnectionclient/overview.md) |
| SAIF.NetCore.ErrorHandler | Provides exception logging and response handling for web hosts and Windows Services. | [Index](docs/libraries/saif-netcore-errorhandler/index.md) | [Documentation](docs/libraries/saif-netcore-errorhandler/overview.md) |
| SAIF.NetCore.HttpClients | Provides reusable authenticated, retry-capable JSON HTTP client services. | [Index](docs/libraries/saif-netcore-httpclients/index.md) | [Documentation](docs/libraries/saif-netcore-httpclients/overview.md) |
| SAIF.NetCore.LegacyAuth | Bridges modern authentication flows to legacy applications with DPAPI-encrypted cookies. | [Index](docs/libraries/saif-netcore-legacyauth/index.md) | [Documentation](docs/libraries/saif-netcore-legacyauth/overview.md) |
| SAIF.NetCore.OIDC | Implements OIDC authentication, cookie maintenance, and token-refresh behavior. | [Index](docs/libraries/saif-netcore-oidc/index.md) | [Documentation](docs/libraries/saif-netcore-oidc/overview.md) |
| SAIF.NetCore.Clients.UC4 | Provides a typed client for scheduling UC4/Automic jobs. | [Index](docs/libraries/saif-netcore-clients-uc4/index.md) | [Documentation](docs/libraries/saif-netcore-clients-uc4/overview.md) |
| SAIF.NetCore.WindowsService | Provides hosting and recurring-worker patterns for Windows Services. | [Index](docs/libraries/saif-netcore-windowsservice/index.md) | [Documentation](docs/libraries/saif-netcore-windowsservice/overview.md) |
| SAIF.NetCore.NtlmApiAuth | Provides caller and on-behalf-of role authorization for APIs and HTTP clients. | [Index](docs/libraries/saif-netcore-ntlmapiauth/index.md) | [Documentation](docs/libraries/saif-netcore-ntlmapiauth/overview.md) |
| SAIF.NetCore.ServiceExtensions | Composes dependency injection, startup, middleware, and observability for SAIF applications. | [Index](docs/libraries/saif-netcore-serviceextensions/index.md) | [Documentation](docs/libraries/saif-netcore-serviceextensions/overview.md) |

_Last updated: 2026-10-03_

---

## Sources
- `Architecture.md`
- `Pipelines.md`
