FivePD API
Interfaces/VariableData

IVariableDataService

Handles the dynamic data sets and entities.

Methods

RegisterAddonRepository

Registers the given .

Parameters

NameTypeDescription
repositoryTRThe repository to register.

RegisterSetAttributes

Registers attributes to the given dynamic data set type.

Parameters

NameTypeDescription
attributesList<VariableDataAttribute>The attributes to register.

UpdateSetAttribute

Updates the attribute of the given name with the values of . Can't update another addon's attribute or change its data type.

Parameters

NameTypeDescription
attributeNamestringThe attribute's name to delete.
newAttributeValuesVariableDataAttributeThe new values of the attribute.

DeleteSetAttribute

Deletes an attribute with the given name from the set. Can't delete another addon's attribute.

Parameters

NameTypeDescription
attributeNamestringThe attribute's name to delete.

OnAdded

Fires when an entity is added to the given set either via the API or the NUI.

Parameters

NameTypeDescription
observerAction<VariableDataEvent>The action that will executed upon firing with the added entity.

Returns

NameType
IDisposableA disposable .

OnUpdated

Fires when an entity in the given set is edited either via the API or the NUI.

Parameters

NameTypeDescription
observerAction<VariableDataEvent>The action that will executed upon firing with the edited entity.

Returns

NameType
IDisposableA disposable .

OnDeleted

Fires when an entity from the given set is deleted either via the API or the NUI.

Parameters

NameTypeDescription
observerAction<VariableDataEvent>The action that will executed upon fire deleted entity.

Returns

NameType
IDisposableA disposable .

AddEntity

Inserts an entity into the database with all its values mapped to the attributes of the given set. If a property doesn't exist as an attribute it won't be saved.

Parameters

NameTypeDescription
entityToAddVariableDataEntityThe entity to insert.

Returns

NameType
VariableDataEntityThe inserted entity.

UpdateEntity

Updates the values of the entity in the database.

Parameters

NameTypeDescription
entityToUpdateVariableDataEntityThe entity to update.

DeleteEntity

Deletes an entity.

Parameters

NameTypeDescription
entityToDeleteVariableDataEntityThe entity to delete.

GetEntity

Finds and maps the first entity with the given id.

Parameters

NameTypeDescription
idstringThe id of the entity.

Returns

NameType
VariableDataEntityThe first entity with the given id.

GetEntity

Finds and maps the first entity with the given id.

Parameters

NameTypeDescription
idstringThe id of the entity.
withTrackingboolWhether to track the entities or not.
queryCoreAttributeValueboolWhether to query the core attribute values or not.

Returns

NameType
VariableDataEntityThe first entity with the given id.

GetEntities

Finds and maps all entities of the given set.

Parameters

NameTypeDescription
withTrackingboolWhether to track the entities or not.
queryCoreAttributeValueboolWhether to query the core attribute values or not.
filterDictionary<string, object>The filter to apply to the query.

Returns

NameType
List<VariableDataEntity>All entities of the set.

GetEntities

Finds and maps all entities of the given set.

Parameters

NameTypeDescription
setTypeTypeThe id of the set.
withTrackingboolWhether to track the entities or not.
queryCoreAttributeValueboolWhether to query the core attribute values or not.
filterDictionary<string, object>The filter to apply to the query.

Returns

NameType
List<VariableDataEntity>All entities of the set.

DisposeAddonRepositories