IErpComplexType Interface

Provides the interface holding metadata about an OData complex type,
often used by ERP systems to group related properties and provide additional information for entities (for example: SAP Gateway).

Namespace: powerGate.Erp.Client
Assembly: powerGate.Erp.Client.dll

Syntax

1
public interface IErpComplexType

Properties

Type

Name

Description

../../../_images/prop.ico IErpService

Service

Gets the service where the complex type is defined.

../../../_images/prop.ico string

Name

The name of the complex type.

../../../_images/prop.ico string

Namespace

The namespace where the complex type is located in.

../../../_images/prop.ico IErpProperties

Properties

Gets all properties of a primitive- or enumeration type, including collection-valued properties of these types.

../../../_images/prop.ico IErpComplexTypeProperties

ComplexTypeProperties

Gets all properties that reference other complex types.

../../../_images/prop.ico IErpNavigationProperties

NavigationProperties

Gets all properties that define relationships to entity types.

Methods

Type

Name

Description

../../../_images/method.ico ErpObject

NewErpObject()

Creates a new and empty ErpObject instance of the current complex type. The properties will be filled with the default values.

Remarks

Similar to an IErpEntityType, also a complex type defines a structure of properties. However, it does not define keys and is therefore not directly associated with an EntitySet.
Instead, a ComplexType can be referenced by one or multiple entity types.

Complex Type values are therefore created, read and updated through the entity or operation that contains them.

Further details on the NewErpObject() method can be found in the IErpEntityType - Remarks section.

Examples

Create a new Complex Type value

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
using powerGate.Erp.Client;

namespace ComplexTypeSample {
        class Program
        {
                static void Main(string[] args)
                {
                        using (var erpclient = new ErpClient())
                        {
                            using (var service = erpclient.ConnectErp(new Uri("http://services.odata.org/V4/OData/(S(fa2g1e4kjczcfnog0asxmvhh))/OData.svc")))
                            {
                                var supplier = service.EntityTypes["ODataDemo.Supplier"].NewErpObject();
                                supplier["ID"] = 66;
                                supplier["Name"] = "Contoso Ltd.";

                                var address = supplier.EntityType.ComplexTypeProperties["Address"].TargetType.NewErpObject();
                                address["Street"] = "Industriestrasse 1";
                                address["City"] = "Linz";
                                
                                supplier["Address"] = address;
                            }
                        }
                }
        }
}

See also

Reference