Giter VIP home page Giter VIP logo

Comments (3)

cleftheris avatar cleftheris commented on August 11, 2024

Also A "Position/Index" is handy when inside the elements themselves.

from edi.net.

cleftheris avatar cleftheris commented on August 11, 2024

The attribute should also have a scope. Something like Container & Self. This will make a distinction when dealing lets say with structural segments like the Message trailer segment where where is need to present the segment count inside the parent container (The message) and not the self container (the segment)

from edi.net.

cleftheris avatar cleftheris commented on August 11, 2024

In the end I settled with EdiCountAttribute that counts controls. That is contextual numbers of Segments, Messages and Groups.
At the moment it is used only in the EdiWriter when serializing. (EdiReader does not do validation with se same mechanism, at least not yet)
If placed on a model value property alongside with the EdiValueAttribute it will override any existing value found in the model with the correct count from within the writer.

Some exmples fox X12 (same applies for EDIFact as well).

public class Interchange
{
 /* ... other properties ... */
        [EdiValue("9(1)", Path = "IEA/0", Description = "IEA01 - Num of Included Functional Grps")]
        [EdiCount(EdiCountScope.Groups)]
        public int GroupsCount { get; set; }
}

[EdiGroup]
public class FunctionalGroup
{
 /* ... other properties ... */
       [EdiValue("9(1)", Path = "GE/0", Description = "97 Number of Transaction Sets Included")]
       [EdiCount(EdiCountScope.Messages)]
       public int TransactionsCount { get; set; }
}

 [EdiMessage]
 public class Message
 {
 /* ... other properties ... */
       [EdiValue(Path = "SE/0", Description = "SE01 - Number of included segments")]
       [EdiCount(EdiCountScope.Segments)]
       public int SegmentsCount { get; set; }
}

from edi.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.