---
title: SAIF.Framework.Core overview
summary: High-level purpose, scope, and responsibilities for this library.
status: draft
owner: <owner>
last_reviewed: 2026-09-15
library: SAIF.Framework.Core
reference_type: package
---

# SAIF.Framework.Core overview

> **Documentation context:** Packaged Component (NuGet)

SAIF.Framework.Core is a cross-cutting platform framework — not a business-domain library — and is the root of the SAIF.Framework.* family: it is the package other Framework4-classified libraries reference (`SAIF.Framework.*`), and it defines the foundational abstractions those libraries and consuming applications build on, including environment/configuration resolution, Active Directory-backed authorization, a generic data-access contract, and WCF/REST-fronted platform services.

## Purpose
- Serve as the root framework library of the SAIF.Framework.* family: it defines the `IEnvironmentService`/`EnvironmentServiceBase` environment-configuration abstraction, the `IUnitOfWork`/`IRepository<TEntity>` data-access contract, and the Autofac-based composition pattern (`ServiceRegistrations`) that every downstream Framework4 library and consuming application relies on.
- Provide a first-class Active Directory integration provider (`ADService`, `MachineSecurityService`) and front two external, configurable security back ends — a WCF `SecurityService` and a REST Security API — behind framework-owned façades (`SecurityGroupService`, `SystemUserProfile`, `SecurityApiClient`).
- Implement concrete platform services — validation, document generation, fax, imaging, PDF, print, preference, UC4, work-calendar, user-profile, email, and logging — each backed by a WCF/REST client proxy, so application code depends only on framework interfaces rather than on WCF channel plumbing.
- Consumed by downstream Framework4 libraries (project references and NuGet package consumers of `SAIF.Framework.Core`) and by web/Windows applications built on the SAIF platform, via the `ServiceRegistrations.RegisterCoreServicesForWeb`/`RegisterCoreServicesForWindows` Autofac composition entry points.

## Responsibilities
- Define and implement the environment/configuration abstraction (`IEnvironmentService`, `EnvironmentServiceBase` and its four concrete subclasses) with layered configuration resolution: developer-override JSON → in-memory cache → Environment API section fetch.
- Provide AD group-membership lookups (`ADService`) and machine-authorization gating (`MachineSecurityService`), used internally to determine developer-machine status and exposed as a general capability.
- Front the WCF `SecurityService` and REST Security API behind framework façades for resource/role authorization and user-profile retrieval.
- Define the generic repository/unit-of-work data-access contract (`IUnitOfWork`, `IRepository<TEntity>`, `IRepositoryFactory`, `ISessionHelper`) consumed by downstream libraries; ships only an in-memory `TestRepository`/`TestUnitOfWork` test double, no production implementation.
- Implement validation (`FluentValidationService`), document/fax/imaging/PDF/print services, user-profile services, and a REST-backed log4net appender.
- Supply the Autofac composition root (`ServiceRegistrations`) that consuming applications call at startup.

## Key components
- `IEnvironmentService` / `EnvironmentServiceBase`: central configuration/context contract and its four concrete environment flavors (`WindowsEnvironmentService`, `WebEnvironmentService`, `WcfEnvironmentService`, `CustomEnvironmentService`).
- `ADService` / `MachineSecurityService`: direct Active Directory group-membership provider and machine-authorization façade.
- `SecurityGroupService` / `SystemUserProfile` / `SecurityApiClient`: WCF and REST security façades fronting external authorization back ends.
- `IUnitOfWork` / `IRepository<TEntity>` / `IRepositoryFactory`: generic data-access abstraction (contract only; in-memory `TestRepository` test double shipped here).
- `FluentValidationService` / `ValidatorFactory`: validation service built on FluentValidation and Autofac.
- `Services.Utilities.Documents.*` (`DocumentService`, `FaxService`, `ImagingService`, `PDFService`, `PdfConvertAndMergeService`, `PrintService`): WCF/SOAP-backed document processing services.
- `UserProfileService` and the `ApplicationUserProfile`/`ExternalUserProfile`/`SaifUserProfile`/`SystemUserProfile` family: user-profile model and retrieval.
- `ServiceRegistrations`: Autofac composition root (`RegisterCoreServicesForWeb`/`RegisterCoreServicesForWindows`).

## Related documentation
- [Index](index.md)
- [Architecture](architecture.md)
- [Dependencies](dependencies.md)
- [Configuration](configuration.md)
- [Operations and processes](operations-processes.md)
- [Business rules](business-rules.md)
- [Security and authorization](security-authorization.md)
- [API reference](api/index.md)

## Sources
- `Core\SAIF.Core\SAIF.Framework.Core.csproj`
- `Core\SAIF.Core\SAIF.Framework.Core.nuspec`
- `Core\SAIF.Core\Core\Services\IEnvironmentService.cs`
- `Core\SAIF.Core\Services.Common\EnvironmentServiceBase.cs`
- `Core\SAIF.Core\Core\Services\ADService.cs`
- `Core\SAIF.Core\Core\Services\MachineSecurityService.cs`
- `Core\SAIF.Core\Services\ServiceRegistrations.cs`
- `Core\SAIF.Core\Data\Interfaces\IUnitOfWork.cs`
