Giter VIP home page Giter VIP logo

Comments (3)

cleftheris avatar cleftheris commented on August 11, 2024 1

Hi @AlittleBird2023 and thanks for your interest in EDI.Net.

The path is interpreted contextually. This means that when paired with an EdiElement attribute it is interpreted as one level path and on an EdiValue attribute it is always treated as a two level path (element index, component index). That said, when the zero index is omitted it is considered implied so in an EdiValue

Check these examples for the EdiValue

  • DTM == DTM/0 == DTM/0/0
  • DTM/1 == DTM/1/0

Accordingly for an Element

  • DTM == DTM/0

Hope this helps.

C.

from edi.net.

AlittleBird2023 avatar AlittleBird2023 commented on August 11, 2024

Thanks @cleftheris for your quick reponse!

So, in the following example:

    [EdiSegment, EdiSegmentGroup("PO1", SequenceEnd = "CTT")]
    public class OrderDetail
    {
        ...

        [EdiCondition("018", Path = "DTM/0/0")]
        public DTM AvailableFromDate { get; set; }

        [EdiCondition("067", Path = "DTM/0/0")]
        public DTM ArrivalDate  { get; set; }

        [EdiCondition("002", Path = "DTM/0/0")]
        public DTM DeliveryRequestedDate { get; set; }

        [EdiCondition("038", Path = "DTM/0/0")]
        public DTM ShipNoLaterDate { get; set; }

        ...
    }

    [EdiSegment, EdiPath("DTM")]
    public class DTM
    {
        [EdiValue(Path = "DTM/0", Description = "DTM01 - Date/Time Qualifier")]
        public string DateTimeQualifier { get; set; }

        [EdiValue("9(8)", Path = "DTM/1", Format = "yyyyMMdd", Description = "DTM02 - Date format =CCYYMMDD")]
        public DateTime Date { get; set; }
    }

The condition path "DTM/0/0" in class OrderDetail can be rewritten to "DTM/0" because there are no components in element DateTimeQualifier, right?

from edi.net.

cleftheris avatar cleftheris commented on August 11, 2024

There are always components involved on the value level.
For example the following line represents a DTM segment with one element and inside of that one component
DTM+137
While this has one element and 3 components.
DTM+137:20060619165058:203

The component it there regardless of the delimiter.
For the condition attribute always express the full path for the value - don't use the short versions.

A side note do prefer the explicit EdiSegmentGroup declaration over the SequenceEnd. The former is the one that you have to declare all direct desendant segment names while the latter will only get you so far on simple usecases. Checkout examples in the tests project

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.