none
Create object which has child properties within properties RRS feed

  • Question

  • Getting right into it...

    I am familiar with creating custom object models and such. However, I am trying to create a model that has child properties within properties.

    Here is what I have (mapped)

    Object
     |
      -- Guid Id
      -- string HandlerPrefix
      -- long SeperationVertex
      -- bool IsDirty

    This is what I need (mapped)

    Object
     |
      -- Guid Id
      -- string HandlerPrefix
      -- ?? SeperationVertex
       |
        -- long VertexHigh
        -- long VertexLow
        -- int Polarity
      -- bool IsDirty
    Any idea how I nest the three child properties into the SeperationVertex property of this object?

    Monday, January 6, 2014 5:18 AM

Answers

  • you need to create another class SeperationVertexClass and use it as a property. thats the oop way.
    • Proposed as answer by JayChase Monday, January 6, 2014 11:38 AM
    • Marked as answer by Caillen Wednesday, January 15, 2014 3:08 AM
    Monday, January 6, 2014 5:44 AM
  • Create a separate class or structure for SeperationVertex that has the three properties, then in your main object instead of using a long for SeperationVertex, use an instance of the new class/structure.

    - Brady My posts are kept as simple as possible for easier understanding. In many cases you can probably optimize or spruce up what I present. Have fun coding!

    • Marked as answer by Caillen Wednesday, January 15, 2014 3:08 AM
    Monday, January 6, 2014 5:44 AM

All replies

  • you need to create another class SeperationVertexClass and use it as a property. thats the oop way.
    • Proposed as answer by JayChase Monday, January 6, 2014 11:38 AM
    • Marked as answer by Caillen Wednesday, January 15, 2014 3:08 AM
    Monday, January 6, 2014 5:44 AM
  • Create a separate class or structure for SeperationVertex that has the three properties, then in your main object instead of using a long for SeperationVertex, use an instance of the new class/structure.

    - Brady My posts are kept as simple as possible for easier understanding. In many cases you can probably optimize or spruce up what I present. Have fun coding!

    • Marked as answer by Caillen Wednesday, January 15, 2014 3:08 AM
    Monday, January 6, 2014 5:44 AM