---
title: PolicyQueryProvider
summary: API reference for PolicyQueryProvider.
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data
reference_type: package
---

# PolicyQueryProvider

Query provider exposing 6 data-access operation(s) (`GetBusiness`, `GetGroupAssociation`, `GetNonPolicyAccount`, `GetPayrollReportForReportId`, `GetPolicy`, `GetPolicyTeamFunction`) against 7 distinct table(s); see [sql/index.md](../../sql/index.md) for the full ORM operation catalog.

## Purpose
- Provides read/write access to 7 table(s) via NHibernate `IQueryable<T>`/`GetRepository<T>()` calls documented in [sql/index.md](../../sql/index.md).
- Exposes 6 public query/command method(s) consumed by higher application layers; see [database-tables.md](../../database-tables.md) for the underlying schema.

## Context
- Namespace: `SAIF.Data.Queries.Policies`
- Assembly/package: `SAIF.Data`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| GetPolicy | `Policy GetPolicy(long policyNumber)` | Executes an ORM query ([SQL-194](../../sql/SQL-194-policy-query-provider-get-policy.md)) against [POLICY](../../database-tables.md#policy). |
| GetNonPolicyAccount | `NonEmployerAccount GetNonPolicyAccount(long accountNumber)` | Executes an ORM query ([SQL-195](../../sql/SQL-195-policy-query-provider-get-non-policy-account.md)) against [NON_EMPR_ACCT](../../database-tables.md#non_empr_acct). |
| GetPolicyTeamFunction | `PolicyTeamFunction GetPolicyTeamFunction(long policyNumber, string teamFunctionCode)` | Executes an ORM query ([SQL-196](../../sql/SQL-196-policy-query-provider-get-policy-team-function.md)) against [POLICY_TEAM_FUNCTION](../../database-tables.md#policy_team_function). |
| GetBusiness | `Business GetBusiness(long policyNumber)` | Executes an ORM query ([SQL-197](../../sql/SQL-197-policy-query-provider-get-business.md)) against [BUSINESS](../../database-tables.md#business). |
| GetGroupAssociation | `PolicyPeriodGroupAssoc GetGroupAssociation(long policyNumber, DateTime effectiveDate)` | Executes an ORM query ([SQL-198](../../sql/SQL-198-policy-query-provider-get-group-association.md)) against [POLICY_PERIOD_GROUP_ASSOC](../../database-tables.md#policy_period_group_assoc), [POLICY](../../database-tables.md#policy), [Policy_Period](../../database-tables.md#policy_period). |
| GetPayrollReportForReportId | `PolicyPeriodPayrollAudit GetPayrollReportForReportId(long reportId)` | Executes an ORM query ([SQL-199](../../sql/SQL-199-policy-query-provider-get-payroll-report-for-report-id.md)) against [POLICY_PERIOD_PAYROLL_AUDIT](../../database-tables.md#policy_period_payroll_audit). |
| PolicyQueryProvider(IRepositoryFactory factory, ILocationQueryProvider locationQueryProvider) | `PolicyQueryProvider(IRepositoryFactory factory, ILocationQueryProvider locationQueryProvider)` | Initializes a new instance, wiring the repository factory used by this provider's query methods.* |

## Behavioral notes
- Query methods build LINQ expressions over `IQueryable<T>` obtained via `Factory.GetRepository<T>()` and execute them against the underlying NHibernate session.*

## Constraints and usage notes
- Instances are constructed with an `IRepositoryFactory` and are expected to be resolved through dependency injection rather than instantiated directly.*

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

## Sources
- `Data/SAIF.Data/Queries/Policies/PolicyQueryProvider.cs`
