-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Path fragment supports range style notation 1..* or 2..4
related #170
- Loading branch information
1 parent
82030c0
commit 8d5ed96
Showing
5 changed files
with
127 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
test/indice.Edi.Tests/Models/EdiFact_Issue170_ElementList.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using indice.Edi.Serialization; | ||
|
||
namespace indice.Edi.Tests.Models | ||
{ | ||
public class EdiFact_Issue170_ElementList | ||
{ | ||
public Message Msg { get; set; } | ||
|
||
[EdiMessage] | ||
public class Message | ||
{ | ||
public List<InteractiveFreeText> InteractiveFreeTexts { get; set; } | ||
} | ||
|
||
[EdiSegment, EdiPath("IFT")] | ||
public class InteractiveFreeText | ||
{ | ||
[EdiValue("X(3)", Mandatory = true, Description = "C346-4451", Path = "IFT/0")] | ||
public string Code { get; set; } | ||
|
||
[EdiValue("X(4)", Description = "C346-9980", Path = "IFT/0/1")] | ||
public string CodeId { get; set; } | ||
|
||
[EdiValue("X(3)", Description = "C346-4405", Path = "IFT/0/2")] | ||
public string Fare { get; set; } | ||
|
||
public List<FreeText> Texts { get; set; } | ||
|
||
public override string ToString() => string.Join(" ", Texts); | ||
} | ||
|
||
[EdiElement, EdiPath("IFT/1..*")] // This take only index [1], but not from [1..*]] | ||
public class FreeText | ||
{ | ||
[EdiValue("X(70)", Path = "IFT/*/0")] | ||
public string Text { get; set; } | ||
|
||
public override string ToString() => Text; | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
test/indice.Edi.Tests/Samples/edifact.Issue170.ElementList.edi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
UNB+XXXX' | ||
UNH+000001' | ||
IFT+1:1+This+is+the first' | ||
IFT+1:2+And+this is+the seccond' | ||
IFT+1:3+while+this+should come third' | ||
UNT+3' | ||
UNZ+1' |