--- myst: substitutions: method: |- ```{image} /img/code_reference/net_library/method.ico ``` prop: |- ```{image} /img/code_reference/net_library/prop.ico ``` --- # IErpServices Interface Provides the interface for working with a collection of ERP Services. **Namespace:** powerGate.Erp.Client\ **Assembly:** powerGate.Erp.Client.dll ## Syntax ```{code-block} CSharp :linenos: public interface IErpServices : IEnumerable ``` ## Properties | Type | Name | Description | |--------------------------|--------------------|----------------------------------------------------| | {{prop}} [IErpService][] | Item\[Uri url\] | Gets the service with the specified Uri. | | {{prop}} [IErpService][] | Item\[string url\] | Gets the service with the specified url as string. | ## Methods | Type | Name | Description | |--------------------------------------------|--------------------------|---------------------------------------------------------------------------------------------------| | {{method}} IEnumerable \<[IErpService][]\> | Find(string serviceName) | Searches for services having the specified serviceName. | | {{method}} IEnumerator \<[IErpService][]\> | GetEnumerator() | Returns an enumerator that iterates through the collection.(Inherited from [IEnumerable\][]). | [IErpService]: ierpservice [IEnumerable\]: https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 ## Remarks The **Item\[\]** property and **Find()** function are supporting to pass only parts of the service Url (e.g. MaterialService instead of ).) ## Examples In the following examples we are using public OData Services () for demonstration purposes. **Get service by url** ```{code-block} CSharp :linenos: //ErpClient already connected to Odata services var service = erpclient.Services[new Uri("http://services.odata.org/V4/Northwind/Northwind.svc")] Console.Write("Service: {0}", service.Name); ``` **Find service by name** ```{code-block} CSharp :linenos: //ErpClient already connected to powerGateServer Catalogservice var services = erpclient.Services.Find("MaterialService"); foreach (IErpService service in services) Console.Write("Service: {0}", service.Name); ``` ## See also **Reference** - [powerGate.Erp.Client namespace]() - [Get-ERPServices cmdlet]()