Skip to content

Instantly share code, notes, and snippets.

@rofr
Created November 10, 2016 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rofr/9790c092fb0975548d0c3e0301ca5888 to your computer and use it in GitHub Desktop.
Save rofr/9790c092fb0975548d0c3e0301ca5888 to your computer and use it in GitHub Desktop.
public class TextLiteral
{
[EdifactElement(0)]
public string Line0 { get; set; }
[EdifactElement(1, required: false)]
public string Line1 { get; set; }
[EdifactElement(2, required: false)]
public string Line2 { get; set; }
[EdifactElement(3, required: false)]
public string Line3 { get; set; }
[EdifactElement(4, required: false)]
public string Line4 { get; set; }
public IEnumerable<string> Lines
{
get
{
yield return Line0;
if (Line1 != null) yield return Line1;
if (Line2 != null) yield return Line2;
if (Line3 != null) yield return Line3;
if (Line4 != null) yield return Line4;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment