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

# ImageDeleter

Implements `IImageDeleter`, the group-imaging delete operation invoked by `SAIF.Services.Groups.Imaging.ImageService.DeleteImage`. It depends on `IValidationService` to validate the delete request, `IGroupImageRepository` to perform the actual deletion, and `IGroupImageSecurityProvider` to stamp the deleting user's ID onto the delete record.

## Purpose
- Validates an `ImageDelete` request before allowing deletion to proceed.
- Deletes a group image by recording a `Data.Model.Groups.ImageDelete` entry with the current timestamp and user ID.

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

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| ImageDeleter(...) | `public ImageDeleter(IValidationService validationService, IGroupImageRepository groupImageRepository, IGroupImageSecurityProvider security)` | Wires in the validation, repository, and security collaborators used by `Delete`. |
| Delete | `public void Delete(ImageDelete imageDelete)` | Validates `imageDelete` (throwing on failure via `ValidateAndThrow`), then deletes the target image group, recording the deletion timestamp and current user ID. |

## Behavioral notes
- `Delete` calls `validationService.ValidateAndThrow`, which throws rather than returning a message list, so callers must handle validation failures as exceptions rather than as a result object*.
- The actual removal is delegated entirely to `groupImageRepository.Delete`; this type does not itself manage a unit-of-work transaction boundary — that is the caller's (`ImageService.DeleteImage`) responsibility*.

> **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/Groups/Imaging/ImageDeleter.cs
