Comments (4)
Yes sorry I forgot I want to serialize
from edi.net.
I suspect you want to serialize,
am I correct?
from edi.net.
You can checkout the test I reference in the commit above 70a3674.
But your main issue even if the path annotations where right would be that your List property is marked as private so the serializer would not even pick it up.
The correct path annotations would be as the following snippet:
[EdiSegment, EdiPath("GIN")]
public class GIN
{
[EdiValue("X(3)", Path = "GIN/0/0")]
public string Qualifier { get; set; }
[EdiPath("GIN/1..*")]
public List<IdentityNumber> IdentityNumbers { get; set; }
[EdiElement]
public class IdentityNumber
{
[EdiValue("X(35)", Path = "*/*/0")]
public string Text { get; set; }
}
}
- The list path annotates the list structure not the list item itself so
[EdiPath("GIN/1..*")]
goes toList<IdentityNumber>
prop - The structure that contains the values that repeat must be annotated as
[EdiElement]
. No need to declare a path here since it is defined on the list property. - The
IdentityNumber
element class must have all its component value properties annotated with wildcard paths for the element index so it can be substituted by the serializer. That would look like[EdiValue("X(35)", Path = "GIN/*/0")]
forIdentityNumber.Text
- (Optional) since the IdentityNumber class may be encountered under a different segment context as a reusable element you can also wildcard the segment name. That would make the path on
IdentityNumber.Text
be annotated like so[EdiValue("X(35)", Path = "*/*/0")]
from edi.net.
Sorry I was on holiday.
Just tried out and works like a charm. Thanks a lot.
from edi.net.
Related Issues (20)
- Question for path HOT 3
- X12 - automatic detection of grammar
- Set font when use EdiSerializer().Deserialize
- X12 - Segment ISA - Component element separator HOT 2
- X12 - Reuse data segment code (example: N1 Loop Party Identification) HOT 1
- X12 - N1 Loop PartyIdentification for EDI 940 HOT 1
- Parser cannot process escaped plus sign for phone number in PartyMutuallyDefined NAD record HOT 1
- Two segment groups with the same path HOT 1
- Repeating element groups within segment for X12 830 HOT 1
- Repeated elements in a segment
- Picture with implicit V9 on decimal? still adds a decimal separator HOT 4
- [Q] Error was thrown for repeated segment groups HOT 3
- EdiCondition not working to RFF+CR HOT 1
- .net8 HOT 1
- Help understanding EdiSegment Path settings HOT 3
- Some Segments does not map properly
- Enum deserialization does not work
- X12 270/271 Eligibility Benefit Inquiry
- TradaComs26v3 file Charge lines contain `=` sign in TCOD TariffDescription HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from edi.net.