indice-co / EDI.Net

EDI Serializer/Deserializer. Supports EDIFact, X12 and TRADACOMS formats
MIT License
447 stars 170 forks source link

POCO Annotation from EDI Documentation Examples #227

Open cvboucher opened 2 years ago

cvboucher commented 2 years ago

I need to deserialize the following EDI format/files into POCO classes.

https://static.ark.org/eeuploads/adhe/TS130.pdf

I'm a .Net developer but brand new to EDI. Are there some examples on how to structure and annotate POCO's from the EDI documentation? I've looked at the example POCO's here but it's still not clear how to translate from the documentation to the classes.

Thanks.

tcsyring commented 2 years ago
var grammar = EdiGrammar.NewX12();

 var interchange = default(GenericX12);
            using (var stream = new StreamReader(filePath))
            {
                interchange = new EdiSerializer().Deserialize<Generic834>(stream, grammar);
            }

Where GenericX12 is your POCO class.