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

# IFileConfiguration

`IFileConfiguration` is the resolved, runtime layout contract consumed by [`FileReader<TRecord>`](../saif.common.files.core/FileReaderOfT.md) and [`FileWriter<TRecord>`](../saif.common.files.core/FileWriterOfT.md) to discover a record type's format, header handling, trim behavior, and per-property layouts ([BR-001](../../business-rules.md#br-001-default-configuration-required), [BR-002](../../business-rules.md#br-002-single-isdefault-configuration-required-among-multiple), [BR-003](../../business-rules.md#br-003-requested-format-must-match-a-declared-configuration)). Implementations are produced either by reflecting over `FormatBase`-derived attributes on a record type or by the fluent API on `FileConfiguration<T>`.

## Purpose
- Declares whether a configuration is the default one to use when a caller does not request a specific format ([BR-001](../../business-rules.md#br-001-default-configuration-required), [BR-002](../../business-rules.md#br-002-single-isdefault-configuration-required-among-multiple)).
- Declares whether the first data row is a header row to be skipped on read ([BR-006](../../business-rules.md#br-006-header-record-skipped-when-declared)).
- Declares the field-level trim behavior applied when reading values ([BR-004](../../business-rules.md#br-004-trimall-trims-field-values-on-read)).
- Exposes the ordered, direction-filtered layout collections (`Layouts`, `WritableLayouts`, `ReadableLayouts`) that the reader/writer iterate to map file fields to/from record properties.

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

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| IsDefault | `bool IsDefault { get; set; }` | Marks this configuration as the one used when a caller requests no specific format ([BR-001](../../business-rules.md#br-001-default-configuration-required)). |
| HasHeaderRecord | `bool HasHeaderRecord { get; set; }` | Indicates the file's first record is a header line to be skipped on read and emitted on write ([BR-006](../../business-rules.md#br-006-header-record-skipped-when-declared)). |
| Format | `FileFormats Format { get; set; }` | The layout strategy (CSV, Fixed, TabDelimited, Delimited, MultipleRecord) this configuration represents. |
| Delimiter | `string Delimiter { get; set; }` | The field-separator string used for delimited/CSV/tab-delimited formats. |
| TrimAll | `bool TrimAll { get; set; }` | Controls whether parsed field values are trimmed of surrounding whitespace ([BR-004](../../business-rules.md#br-004-trimall-trims-field-values-on-read)). |
| RecordProperty | `PropertyInfo RecordProperty { get; set; }` | The property that receives the raw, unparsed line value, used for `Record`-derived types ([BR-011](../../business-rules.md#br-011-record-derived-types-round-trip-the-raw-line)). |
| IndexProperty | `PropertyInfo IndexProperty { get; set; }` | The property that receives the record's sequential position within the file. |
| IsRecordBase | `bool IsRecordBase { get; set; }` | Indicates the target record type derives from `Record`, driving raw-line binding instead of per-property layout mapping ([BR-011](../../business-rules.md#br-011-record-derived-types-round-trip-the-raw-line)). |
| Layouts | `List<FileRecordLayout> Layouts { get; }` | The full, unfiltered set of per-property layouts declared for this configuration. |
| WritableLayouts | `IEnumerable<FileRecordLayout> WritableLayouts { get; }` | The layouts eligible for output, ordered by position (fixed format) or element (delimited formats), consumed by `FileWriter<TRecord>` ([BR-015](../../business-rules.md#br-015-output-value-resolution-order)). |
| ReadableLayouts | `IEnumerable<FileRecordLayout> ReadableLayouts { get; }` | The layouts eligible for input, ordered by position (fixed format) or element (delimited formats), consumed by `FileReader<TRecord>` ([BR-012](../../business-rules.md#br-012-delimited-layouts-use-1-based-element-ordinals)). |

## Behavioral notes
- `FileConfiguration` is the concrete class implementing this interface for both attribute-discovered and fluent code-first configurations produced by `FileConfiguration<T>`.

## Sources
- Common\SAIF.Common.Files\Core\Configurations\IFileConfiguration.cs
