---
title: SAIF.Data overview
summary: High-level purpose, scope, and responsibilities for this library.
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data
reference_type: package
---

# SAIF.Data overview

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

SAIF.Data is the data layer of the `SAIF.SAIFCode.Core` NuGet package: it defines roughly 450 NHibernate-mapped entity and DTO models, 37 query providers that read them through `IRepositoryFactory`/NHibernate LINQ, two outbound HTTP clients to Guidewire ClaimCenter and the Medical Billing API, an Autofac registration extension for those clients, and a set of in-memory test-data seeding helpers that ship in the production assembly (`saif-data-analysis.md`).

## Purpose
- Define the entity and DTO model surface consumed and persisted through NHibernate, whose ClassMaps live in the sibling `SAIF.Data.NHibernate` project rather than in this library.
- Provide 37 read-oriented query providers that encapsulate LINQ queries over `Factory.GetRepository<T>().Query()`, plus related claim, bill, e-bill, legal, policy, provider, and task business logic.
- Provide two outbound HTTP clients — `MedicalBillingApiService` and `CCClaimApiService` — to the Medical Billing API and the Guidewire ClaimCenter claim data API.
- Register the data API clients, a Polly cache policy, and Microsoft.Extensions Options/MemoryCache infrastructure through its sole Autofac entry point, `ContainerBuilderExtensions.AddDataClients`.
- It is consumed by `SAIF.Domain`, `SAIF.Services`, `SAIF.Services.ThirdPartyClaim`, `SAIF.Services.WCF`, and `SAIF.Web.Mvc5`, and it depends on `SAIF.Data.Guidewire` for its HTTP client infrastructure.

## Responsibilities
- Model claim, bill, e-bill, collections, legal, policy, provider, document, output-document, task, and RCT domain entities under `Model/**` (`saif-data-analysis.md` Public surface summary).
- Encapsulate read access to Oracle-backed entities through 37 query providers deriving from the external `QueryProviderBase`.
- Combine Oracle entity reads with Guidewire REST data for hybrid claim, MCO, and financial queries (for example `ClaimQueryProvider`, `LegalQueryProvider.GetClaimIdForCase`).
- Resolve service base URLs and secure credentials for its HTTP clients via `IEnvironmentService`, and cache responses through a Polly policy.
- Ship `TestRepository/**` in-memory seeding builders and extensions, even though they are compiled into the production assembly.

## Key components
- `ContainerBuilderExtensions.AddDataClients`: the library's only public Autofac entry point, registering the Guidewire data API clients, `CCClaimApiService`, `MedicalBillingApiService`, and the cache/options infrastructure.
- `HttpClientBase` (local): shared abstract base for `MedicalBillingApiService`, providing lazy URL/AuthKey resolution and Polly-cached GET/POST helpers.
- `CCClaimApiService`: the Guidewire ClaimCenter claim data client, deriving from `SAIF.Data.Guidewire.Clients.HttpClientBase`.
- 37 query providers under `Queries/**` (for example `ClaimQueryProvider`, `BillQueryProvider`, `EbillQueryProvider`, `ProviderQueryProvider`), each with a matching `I*QueryProvider` interface.
- `Model/**`: roughly 450 entity and DTO types mapped externally by `SAIF.Data.NHibernate`.
- `TestRepository/**`: in-memory seeding builders and repository extensions used by test setup.

## 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)
- [Database tables](database-tables.md)
- [SQL catalog](sql/index.md)
- [API reference](api/index.md)

## Sources
- `Data/SAIF.Data/SAIF.Data.csproj`
- `Data/SAIF.Data/Configuration/ContainerBuilderExtensions.cs`
- `Data/SAIF.Data/Clients/HttpClientBase.cs`
- `Data/SAIF.Data/Clients/MedicalBillingApiService.cs`
- `Data/SAIF.Data/Queries/Claims/CCClaimApiService.cs`
- `Core/SAIF.Core/SAIF.SAIFCode.Core.nuspec`
