--- myst: substitutions: ico_method: |- ```{image} /img/code_reference/net_library/method.ico :width: 15px ``` ico_prop: |- ```{image} /img/code_reference/net_library/prop.ico :width: 15px ``` --- # ICustomObjectService Interface Provides functionality to add, search and manipulate custom objects and their definition Syntax. **Namespace:** bcpDevKit\ **Assembly:** bcpDevKit.dll ## Syntax ```csharp public interface ICustomObjectService ``` ## Methods | Type | Name | Description | |-----------------------------|-----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | {{ico_method}} CustomObject | AddCustomObject(string definitionName, string name) | Adds custom entities to the package and creates their definitions if required. definitionName is the singular name of the custom object (e.g. Person). Name should be unique. | | {{ico_method}} CustomObject | GetCustomObject(string definitionName, string name) | Returns an entity of the specified definition if it exists. | ## Remarks *AddCustomObject* handles the creation of the custom object definition and of the custom object itself. It handles the situation when the definition has to be created in the package or when an entity with the same name is already there. ## Examples **Adds a CustomObject "Dragonball"** ```csharp var definition = bcpService.EntitiesTable.CustomObjectWrapper.AddCustomObjectDefinition("Dragonball", "Dragonballs"); definition.SetIcon(@".\Dragon-Ball-icon.ico"); var customObject = bcpService.CustomObjectService.AddCustomObject("Dragonball", "4"); ``` ```{image} /img/code_reference/net_library/dragon-ball-icon.ico :align: left :width: 80px :alt: Click for downloading the Dragonball icon ```