indice-co / EDI.Net

EDI Serializer/Deserializer. Supports EDIFact, X12 and TRADACOMS formats

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Combine condition with value

MikeCrutchfield opened this issue · comments

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

Thanks!