---
title: NameBuilder
summary: API reference for NameBuilder.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-15
library: SAIF.Framework.Common.Files
reference_type: package
---

# NameBuilder

`NameBuilder` generates outbound EDI file names using a fixed, timestamp-prefixed naming pattern, so writer code has a single consistent way to name generated interchange files without formatting the timestamp/environment marker inline at each call site.

## Purpose
- `GetFileName` produces a file name of the form `{yyyyMMddHHmmss}_SAIF_{P|T}_{fileType}.txt`, where the timestamp is taken from `DateTime.Now` at call time and `P`/`T` marks a production vs. non-production (test) file ([BR-055](../../business-rules.md#br-055-generated-edi-file-name-pattern)).
- Operates independently of `SAIF.Framework.Common` — it uses `DateTime.Now` directly rather than delegating to a shared date/time or sequence utility.

## Context
- Namespace: `SAIF.Common.Files.Edi`
- Assembly/package: `SAIF.Framework.Common.Files`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| GetFileName | `public static string GetFileName(string fileType, bool isProd)` | Builds the file name `{yyyyMMddHHmmss}_SAIF_{P|T}_{fileType}.txt` using `DateTime.Now`, `"P"` when `isProd` is `true` or `"T"` otherwise, and the supplied `fileType` ([BR-055](../../business-rules.md#br-055-generated-edi-file-name-pattern)). |

## Constraints and usage notes
- The generated name is only unique to the second; calling `GetFileName` twice within the same second with the same arguments produces an identical name.*

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

## Sources
- Common\SAIF.Common.Files\Edi\NameBuilder.cs
