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

# LocationQueryProvider

Query provider exposing 9 data-access operation(s) (`GetClaimLocationContactWithDefault`, `GetLocation`, `GetLocationContacts`, `GetOfficeCode`, `GetOregonBusinessLocations`, `GetPolcyClaimLocationWithDefault` and 3 more) against 3 distinct table(s); see [sql/index.md](../../sql/index.md) for the full ORM operation catalog.

## Purpose
- Provides read/write access to 3 table(s) via NHibernate `IQueryable<T>`/`GetRepository<T>()` calls documented in [sql/index.md](../../sql/index.md).
- Exposes 9 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.Locations`
- Assembly/package: `SAIF.Data`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| GetLocation | `Location GetLocation(long id)` | Executes an ORM query ([SQL-167](../../sql/SQL-167-location-query-provider-get-location.md)) against [LOCATION](../../database-tables.md#location). |
| GetPolicyLocations | `IQueryable<Location> GetPolicyLocations(long policyNumber)` | Executes an ORM query ([SQL-168](../../sql/SQL-168-location-query-provider-get-policy-locations.md)) against [LOCATION](../../database-tables.md#location). |
| GetPrimaryLocation | `Location GetPrimaryLocation(long policyNumber)` | Executes an ORM query ([SQL-169](../../sql/SQL-169-location-query-provider-get-primary-location.md)) against [LOCATION](../../database-tables.md#location). |
| GetPolicyMailingLocation | `Location GetPolicyMailingLocation(long policyNumber)` | Executes an ORM query ([SQL-170](../../sql/SQL-170-location-query-provider-get-policy-mailing-location.md)) against [LOCATION](../../database-tables.md#location). |
| GetLocationContacts | `IQueryable<Contact> GetLocationContacts(long locationId)` | Executes an ORM query ([SQL-171](../../sql/SQL-171-location-query-provider-get-location-contacts.md)) against [CONTACT](../../database-tables.md#contact). |
| GetPolcyClaimLocationWithDefault | `Location GetPolcyClaimLocationWithDefault(long policyNumber)` | Executes an ORM query ([SQL-172](../../sql/SQL-172-location-query-provider-get-polcy-claim-location-with-default.md)) against [LOCATION](../../database-tables.md#location). |
| GetClaimLocationContactWithDefault | `Contact GetClaimLocationContactWithDefault(long locationId)` | Executes an ORM query ([SQL-173](../../sql/SQL-173-location-query-provider-get-claim-location-contact-with-default.md)) against [CONTACT](../../database-tables.md#contact). |
| GetOfficeCode | `OfficeCode GetOfficeCode(string code)` | Executes an ORM query ([SQL-174](../../sql/SQL-174-location-query-provider-get-office-code.md)) against [OFFICE_CODE](../../database-tables.md#office_code). |
| GetOregonBusinessLocations | `IList<Location> GetOregonBusinessLocations(long policyNumber)` | Executes an ORM query ([SQL-175](../../sql/SQL-175-location-query-provider-get-oregon-business-locations.md)) against [LOCATION](../../database-tables.md#location). |
| LocationQueryProvider(IRepositoryFactory factory) | `LocationQueryProvider(IRepositoryFactory factory)` | 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/Locations/LocationQueryProvider.cs`
