/// <summary> /// Generates a collection of EDI segments. /// </summary> /// <param name="separators">The EDI separators.</param> /// <returns>The collection of EDI segments.</returns> public override IEnumerable <string> GenerateEdi(Separators separators = null) { var result = new List <string>(); var currentSeparators = separators ?? Separators.DefaultSeparatorsEdifact(); if (separators != null) { result.Add(separators.ToUna()); } result.AddRange(ToEdi(Header, currentSeparators)); foreach (var item in Items) { result.AddRange(item.GenerateEdi(currentSeparators)); } result.AddRange(ToEdi(Trailer, currentSeparators)); return(result); }