You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am wondering what is the best way for dealing with optional segments and segment properties, so that I dont end up with a complex object structure that has a large amount of null values?
For example, given an NM1 X12 EDI Segment, which has a total of 12 possible fields, however only the first two or mandatory. Making those optional fields nullable (as shown in the below codeblock) in my model seems to have no effect.
[EdiSegment, EdiPath("NM1")]
public class NM1
{
[EdiValue("X(3)", Path = "NM1/0", Description = "NM101 - Entity Identifier Code")]
public string EntityIdentifierCode { get; set; }
[EdiValue("X(1)", Path = "NM1/1", Description = "NM102 - Entity Type Qualifier")]
public string EntityTypeQualifier { get; set; }
[EdiValue("X(60)", Path = "NM1/2", Description = "NM103 - Name Last or Organization Name")]
public string? NameLastOrOrganizationName { get; set; }
[EdiValue("X(35)", Path = "NM1/3", Description = "NM104 - Name First")]
public string? NameFirst { get; set; }
...
This issue also presents itself when using the segments to create complex EdiSegmentGroup's.
[EdiSegmentGroup("NM1", new[] { "PER", "N3", "N4", "DMG", "EC", "ICM", "AMT", "HLH", "HI", "LUI" })]
public class Loop2100 : NM1
{
public PER PER { get; set; }
public N3? N3 { get; set; }
...
The result is many optional properties with many null values. Is there any way to avoid this?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
I am wondering what is the best way for dealing with optional segments and segment properties, so that I dont end up with a complex object structure that has a large amount of null values?
For example, given an NM1 X12 EDI Segment, which has a total of 12 possible fields, however only the first two or mandatory. Making those optional fields nullable (as shown in the below codeblock) in my model seems to have no effect.
This issue also presents itself when using the segments to create complex EdiSegmentGroup's.
The result is many optional properties with many null values. Is there any way to avoid this?
Thanks in advance!
The text was updated successfully, but these errors were encountered: