Skip to content

IEdiFile

IEdiFile is the contract implemented by EdiFile; it defines the public surface for reading, inspecting, and appending to an EDI interchange, and is the type returned by IEdiFileBuilder.Read() and consumed by IEdiFileBuilder.Write(file).

Purpose

  • Declares the interchange header/trailer accessors, the flat Segments collection, the lazily-built FunctionalGroups hierarchy, and the mutation operations (Add, RefreshGroupings) that any conforming implementation must provide.
  • Lets code depend on the interchange abstraction rather than the concrete EdiFile class, supporting substitution in tests or alternate implementations.*

Context

  • Namespace: SAIF.Common.Files.Edi
  • Assembly/package: SAIF.Framework.Common.Files

Public members

Member Signature Purpose
Header IsaSegment Header { get; } The strongly-typed interchange header parsed from the first ISA segment (BR-029).
HeaderSegment IEdiSegment HeaderSegment { get; } The raw ISA segment instance used as the source for Header.
Trailer IeaSegment Trailer { get; } The strongly-typed interchange trailer parsed from the first IEA segment (BR-029).
TrailerSegment IEdiSegment TrailerSegment { get; } The raw IEA segment instance used as the source for Trailer.
Segments IEnumerable<IEdiSegment> Segments { get; } The full flat, ordered collection of every segment in the interchange, including control segments.
FunctionalGroups IFunctionalGroupContainer FunctionalGroups { get; } The GS/GE-delimited functional-group hierarchy for this file, built only when ISA, IEA, GS, and GE are all present (BR-030).
Add void Add(IEdiSegment segment) Appends a segment to the interchange, assigning it the next sequential index (BR-031) and re-deriving groupings when it is a control segment (BR-032).
RefreshGroupings void RefreshGroupings() Re-locates the ISA/IEA header and trailer and rebuilds functional groups when all four control segments are present (BR-030).
FileName string FileName { get; set; } The file name associated with this interchange.
SegmentCount int SegmentCount { get; } The total number of segments currently in Segments, including control segments.

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\IEdiFile.cs