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

# ImageQueryProvider

Query provider exposing 5 data-access operation(s) (`AlertLegal`, `GetAffilliatedImages`, `GetImage`, `GetImageDocumentType`, `GetImageSystem`) against 4 distinct table(s); see [sql/index.md](../../sql/index.md) for the full ORM operation catalog.

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

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| GetImage | `Image GetImage(long imageId)` | Executes an ORM query ([SQL-147](../../sql/SQL-147-image-query-provider-get-image.md)) against [`Image` (SAIF.Framework mapping; table unknown**)](../../database-tables.md#image). |
| GetAffilliatedImages | `IList<Image> GetAffilliatedImages(long imageId)` | Executes an ORM query ([SQL-148](../../sql/SQL-148-image-query-provider-get-affilliated-images.md)) against [`Image` (SAIF.Framework mapping; table unknown**)](../../database-tables.md#image). |
| GetImageSystem | `ImageSystem GetImageSystem(long towId)` | Executes an ORM query ([SQL-149](../../sql/SQL-149-image-query-provider-get-image-system.md)) against [`ImageSystem` (SAIF.Framework mapping; table unknown**)](../../database-tables.md#imagesystem). |
| GetImageDocumentType | `ImageDocumentTypeCode GetImageDocumentType(string documentCode, string categoryCode, string fileCode)` | Executes an ORM query ([SQL-150](../../sql/SQL-150-image-query-provider-get-image-document-type.md)) against [`ImageDocumentTypeCode` (SAIF.Framework mapping; table unknown**)](../../database-tables.md#imagedocumenttypecode). |
| AlertLegal | `bool AlertLegal(long claimId)` | Executes an ORM query ([SQL-151](../../sql/SQL-151-image-query-provider-alert-legal.md)) against [LEGAL_CASE](../../database-tables.md#legal_case). |
| ImageQueryProvider(IRepositoryFactory factory) | `ImageQueryProvider(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/Policies/Images/ImageQueryProvider.cs`
