---
title: ImageService
summary: API reference for ImageService.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-24
library: SAIF.Services
reference_type: package
---

# ImageService

Implements `IClaimImageService`'s bill-image retrieval by locating the imaging system record associated with a bill (`towId`) and delegating to a `ClaimImage` aggregate (constructed from `IUnitOfWork`) to gather the images affiliated with that record. It is constructed with `IUnitOfWork`, `IValidationService`, `IImagingService`, and `IUserProfileService`, though only the unit of work is currently exercised by the implemented method* — the other three collaborators are retained but unused in the current code.

## Purpose
- Retrieves the set of images affiliated with a given bill's tow ID, returning an empty sequence when no matching, non-deleted image record exists.

## Context
- Namespace: `SAIF.Services.Claims.Imaging`
- Assembly/package: `SAIF.Services` (packaged inside the `SAIF.SAIFCode.Core` NuGet package)

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| ImageService | `public ImageService(IUnitOfWork unitOfWork, IValidationService validationService, IImagingService imageService, IUserProfileService userProfileService)` | Validates that none of the four collaborators is null (via `Enforce.ArgumentNotNull`) and stores them for later use. |
| GetBillImages | `public IEnumerable<Image> GetBillImages(long towId)` | Finds the non-deleted image record for the given tow ID and returns its affiliated image contracts via a `ClaimImage` aggregate, or an empty sequence if no such record exists or it has no data. |

## Behavioral notes
- A static constructor exists but its body (AutoMapper map registration for `Image`/ `ImageAffiliation`) is fully commented out, so no static mapping is currently configured.*
- `GetBillImages` builds a `ClaimImage(unitOfWork, imageId)` helper object and checks its `HasData` property before calling `GetAffilliatedImageContracts()`.
- Private properties `ImageQuery`, `ImageSystemQuery`, and `BillQuery` expose raw `IQueryable` access to the `Image`, `ImageSystem`, and `CbpBill` repositories but are marked unused by static analysis suppressions (`CA1811:AvoidUncalledPrivateCode`), indicating they are not currently called by any public member.*

> **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
- Services/SAIF.Services/Claims/Imaging/ImageService.cs
