Array or list of objects

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
bmt
Jr. Member
Jr. Member
Posts: 2
Joined: 30 Mar 2017, 12:24

Array or list of objects

Post by bmt »

What is the correct way or pattern within .NET SDK to model an object type (using UaModeler) which contains a child that should represent array or list of another object types? To give you an idea I would like to end up with something like this:

Code: Select all

public class DummyObjectType
{
    // variable NodeClass, BaseDataVariableType type definition, String data type
    public string Foo { get; set; }
    // variable NodeClass, BaseDataVariableType type definition, Int32 data type
    public int Bar { get; set; }
    // ? NodeClass, ? type definition, ? data type
    public List<MummyObjectType> Mummies { get; set; }
}

public class MummyObjectType
{
    // variable NodeClass, BaseDataVariableType type definition, Int32 data type
    public int Baz { get; set; }
}

User avatar
Support Team
Hero Member
Hero Member
Posts: 3073
Joined: 18 Mar 2011, 15:09

Re: Array or list of objects

Post by Support Team »

There are the ModellingRules OptionalPlaceholder (0 : n) and MandatoryPlaceholder (1 : n). You can use one of these ModellingRules for modelling arrays of nodes.
Note: The generated Model classes will not contain properties for children specified with one of these ModellingRules.
Best regards
Unified Automation Support Team

bmt
Jr. Member
Jr. Member
Posts: 2
Joined: 30 Mar 2017, 12:24

Re: Array or list of objects

Post by bmt »

Thank you very much.

Post Reply