如何使用 FileHelper FieldOptional
How to use FileHelper FieldOptional
我已经添加了 FieldOptional 属性,但是我仍然收到此错误
行:1列:117.分隔符','在字段'<TrackDate>k__BackingField
'后找不到(记录字段少,分隔符错误或必须标记下一个字段作为可选)。"
我的领域Class:
[DelimitedRecord(",")]
public class MaltaIn
{
[FieldOrder(0)]
public string MilesEventCode { get; set; }
[FieldOrder(1)]
public string MilesEventName { get; set; }
[FieldOrder(2)]
public string ThirdPartyEventCode { get; set; }
[FieldOrder(3)]
public string ThirdPartyEventName { get; set; }
[FieldOrder(4)]
public string ThirdPartyReasonCode { get; set; }
[FieldOrder(5)]
public string MilesRef { get; set; }
[FieldOrder(6)]
public string ThirdPartyRef { get; set; }
[FieldOrder(7)]
public string TrackDate { get; set; }
[FieldOrder(8)]
public string TrackTime { get; set; }
[FieldOrder(9)]
[FieldOptional]
public string OrderNumber;
我是新手..我没看懂错误:(
跟踪日期之后应该是
[FieldOrder(8)]
[FieldOptional]
public string TrackTime;
我已经添加了 FieldOptional 属性,但是我仍然收到此错误
行:1列:117.分隔符','在字段'<TrackDate>k__BackingField
'后找不到(记录字段少,分隔符错误或必须标记下一个字段作为可选)。"
我的领域Class:
[DelimitedRecord(",")]
public class MaltaIn
{
[FieldOrder(0)]
public string MilesEventCode { get; set; }
[FieldOrder(1)]
public string MilesEventName { get; set; }
[FieldOrder(2)]
public string ThirdPartyEventCode { get; set; }
[FieldOrder(3)]
public string ThirdPartyEventName { get; set; }
[FieldOrder(4)]
public string ThirdPartyReasonCode { get; set; }
[FieldOrder(5)]
public string MilesRef { get; set; }
[FieldOrder(6)]
public string ThirdPartyRef { get; set; }
[FieldOrder(7)]
public string TrackDate { get; set; }
[FieldOrder(8)]
public string TrackTime { get; set; }
[FieldOrder(9)]
[FieldOptional]
public string OrderNumber;
我是新手..我没看懂错误:(
跟踪日期之后应该是
[FieldOrder(8)]
[FieldOptional]
public string TrackTime;