Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何读取具有相同标题的所有元素?_C#_Edi.net - Fatal编程技术网

C# 如何读取具有相同标题的所有元素?

C# 如何读取具有相同标题的所有元素?,c#,edi.net,C#,Edi.net,我在构造自定义类以读取EDIFACT文件时遇到问题 这是EDI文件中我遇到问题的部分。 (实际文件是一大行,为了更好地阅读,我在这里将其拆分) 问题是以GIR 我无法使用[EdiCondition]识别它们,因此如果我只是尝试读取它们,我只能得到第三行的值 这是我的班级结构 [EdiElement, EdiPath("GIR", Path ="GIR/*")] public class GoodsRelatedIdentification { [E

我在构造自定义类以读取
EDIFACT
文件时遇到问题

这是EDI文件中我遇到问题的部分。
(实际文件是一大行,为了更好地阅读,我在这里将其拆分)

问题是以
GIR

我无法使用
[EdiCondition]
识别它们,因此如果我只是尝试读取它们,我只能得到第三行的值

这是我的班级结构

[EdiElement, EdiPath("GIR", Path ="GIR/*")]
public class GoodsRelatedIdentification
{
    [EdiValue("X(3)", Path ="GIR/1/0")]
    public string SetIdentificationQualifier { get; set; }

    [EdiValue("X(35)", Path = "GIR/2/0")]
    public string IdentityNumber { get; set; }

    [EdiValue("X(3)", Path = "GIR/2/1")]
    public string IdentityNumberQualifier { get; set; }
}
它在这个类中被称为

[EdiSegment, EdiSegmentGroup("GIN", SequenceEnd = "GIN")]
public class VehicleRecord
{
    [EdiValue("X(3)", Path = "GIN/0/0")]
    public string IdentityNumberQualifier { get; set; }

    [EdiValue("X(17)", Path = "GIN/1/0")]
    public string VehicleIdentificationNo { get; set; }

    public GIN_Reference RFF { get; set; }

    [EdiCondition("30", Path = "TDT/0/0")]
    public DetailsOfTransport_30 TDT_30 { get; set; }

    public GIN_DeliveryLimitations DLM { get; set; }

    public GoodsRelatedIdentification GIR { get; set; }
}
当我这样尝试时,只读取第3行
GIR
行,跳过前2行。
我怎样才能使所有3行都被读取?

您是否尝试过
公共列表GIRs{get;set;}
[EdiSegment, EdiSegmentGroup("GIN", SequenceEnd = "GIN")]
public class VehicleRecord
{
    [EdiValue("X(3)", Path = "GIN/0/0")]
    public string IdentityNumberQualifier { get; set; }

    [EdiValue("X(17)", Path = "GIN/1/0")]
    public string VehicleIdentificationNo { get; set; }

    public GIN_Reference RFF { get; set; }

    [EdiCondition("30", Path = "TDT/0/0")]
    public DetailsOfTransport_30 TDT_30 { get; set; }

    public GIN_DeliveryLimitations DLM { get; set; }

    public GoodsRelatedIdentification GIR { get; set; }
}