IErpService Interface

Provides the interface for working with an ERP Service.

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

Syntax

1
public interface IErpService : IDisposable

Properties

Type

Name

Description

../../../_images/prop.ico IErpEntitySets

EntitySets

Gets all entity sets defined by the service.

../../../_images/prop.ico IErpEntityTypes

EntityTypes

Gets all entity types defined by the service.

../../../_images/prop.ico IErpComplexTypes

ComplexTypes

Gets all complex types defined by the service.

../../../_images/prop.ico IErpOperations

Operations

Gets all OData actions and functions defined by the service.

../../../_images/prop.ico bool

IsAvailable

Indicates whether the service is available.

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

Name

The name of the service.

../../../_images/prop.ico Uri

Url

The Url of the service.

Methods

Type

Name

Description

../../../_images/method.ico object

InvokeErpOperation(string operationName, Dictionary<string, object> parameters = null)

Invokes an unbound OData action or function with the specified name and parameters. Additional parts of the namespace can be included in operationName.

../../../_images/method.ico void

Dispose()

Disconnects the service from the ErpClient. Also Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.(Inherited from IDisposable.)

Remarks

An OData action or function can be either bound or unbound. The service exposes unbound actions and functions through InvokeErpOperation(), while bound actions and functions are typically invoked through an IErpEntitySet or an ErpObject.
When calling Dispose() the service is disconnected from the ErpClient.

If the service is a CatalogService, the CatalogService and all its known services get disconnected.

Examples

Invoking an unbound action

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
using System;
using powerGate.Erp.Client;

namespace ErpServiceSample
{
  class Program
  {
    static void Main(string[] args)
    {
      using (var erpclient = new ErpClient()) {
        using (var service = erpclient.ConnectErp(new Uri("https://services.odata.org/TripPinRESTierService/")))
          service.InvokeErpOperation("ResetDataSource");
      }
    }
  }
}

See also

Reference