EDI.Net
EDI.Net copied to clipboard
Combine condition with value
I am trying to do something like this, but can't get the syntax correct. I am trying to fill in the associated property based on the Condition.
Thanks for any help.
[EdiCondition("010", Path = "DTM/0"), EdiValue(Path = "DTM/1", Format = "yyyyMMdd", Description = "DTM02 - Date format = CCYYMMDD")]
public DateTime RequestedShipDate { get; set; }
[EdiCondition("038", Path = "DTM/0"), EdiValue(Path = "DTM/1", Format = "yyyyMMdd", Description = "DTM02 - Date format = CCYYMMDD")]
public DateTime ShipNoLaterDate { get; set; }
I get nulls for the properties with the above syntax
The incoming segment is like this:
DTM*010*20230204~
DTM*038*20230206~
Unfortunately Conditions do not work directly on values (components). You will have to make a wrapper class for the DTM in order for this to work. Check a sample here https://github.com/indice-co/EDI.Net/blob/ff0ed2b159ba01af55f52b5f34c8486507d801c4/test/indice.Edi.Tests/Models/X12_850.cs#L251
Thanks!