---
title: SAIF.Web.API.Core operations and processes
summary: Business and technical operations supported by this library.
status: draft
owner: andmil
last_reviewed: 2026-09-15
library: SAIF.Web.API.Core
reference_type: package
---

# SAIF.Web.API.Core operations and processes

This library defines almost no multi-step operations: it is primarily a set of inert data-transfer objects (`ApiResponse<T>`, `ErrorResponse`) and exception types with single-assignment constructors, none of which constitute a business operation in their own right. Two pieces of logic in the codebase do have enough control flow to document as operations, and both are catalogued below with their own detail pages under `operations/`.

## Operation catalog
| Operation | Intent | Trigger | Inputs | Outputs | Rules | Tables | SQL |
| --- | --- | --- | --- | --- | --- | --- | --- |
| [Get build info](operations/get-build-info.md) | Read an optional build/version metadata file from a directory and return its contents as key/value pairs, tolerating the file's absence. | Called by a consumer (no in-repo caller found)* | `appDirectory`, optional `buildInfoFilePattern` | `IEnumerable<KeyValuePair<string,string>>` | — | — | — |
| [Construct InvalidDataException from validation failures](operations/construct-invaliddataexception-from-validation-failures.md) | Build an `InvalidDataException` whose message and `ValidationErrors` list are derived from a set of validation failures. | `InvalidDataException(IEnumerable<ValidationFailure> failures)` constructor invoked by a consumer | `IEnumerable<ValidationFailure> failures` | Constructed `InvalidDataException` | [BR-CORE-001](business-rules.md#br-core-001-invaliddataexception-validation-failure-projection) | — | — |

## Process flow diagram
The following diagrams visualize the two documented operations. They are independent entry points with no shared control flow, so each is shown as its own diagram.

The `BuildInfo.GetBuildInfo` flow:

```mermaid
flowchart TD
	Start1(["BuildInfo.GetBuildInfo<br>called"]) --> Search["Search appDirectory for<br>buildInfoFilePattern"]
	Search --> Found{File found?}
	Found -->|No| Seeded(["Return<br>Assembly/Directory pairs<br>only"])
	Found -->|Yes| Parse["Parse each line with<br>key: value regex"]
	Parse --> Combined(["Return seeded + parsed<br>pairs"])
```

The `InvalidDataException` construction flow:

```mermaid
flowchart TD
	Start2(["InvalidDataException<br>constructed with<br>failures"]) --> Project["Project failures to<br>ErrorMessage strings"]
	Project --> Join["Join messages with<br>ToStringAll semicolon"]
	Join --> Assign["Assign joined message<br>and ValidationErrors<br>list"]
	Assign --> Done([Exception ready to throw])
```

## Failure and edge-case behavior
- `BuildInfo.GetBuildInfo`: if no file matches `buildInfoFilePattern` in `appDirectory`, the method does not throw — it silently returns only the seeded `Assembly`/`Directory` entries. Lines in a found file that do not match the `(?<key>\w+): (?<value>.*)` regex are silently skipped, with no error or logging.
- `InvalidDataException(IEnumerable<ValidationFailure>)`: the join implementation (`SAIF.Common.Extensions.ToStringAll`) was not traced beyond its call site, since it is defined in the internal-organization `SAIF.Framework.Common` NuGet package*.

## Related documentation
- [Index](index.md)
- [Overview](overview.md)
- [Architecture](architecture.md)
- [Dependencies](dependencies.md)
- [Business rules](business-rules.md)
- [API reference](api/index.md)

> **Note:** Statements marked with `*` were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts.

## Sources
- `src/SAIF.Web.API.Core/BuildInfo.cs`
- `src/SAIF.Web.API.Core/SAIFException.cs`
