BGEntity API

BGEntity.cs -is a table row, containing 1-n field values. The API list is not full.

Main API

Method/Property Returns Description
Get<type>(string name) type Get field value by field's name. Type should correspond to field's type.
//get int value of "intField" field
int intValue = entity.Get<int>("intField");
Set<type>(string name, type value) void Set field value by field's name. value should have the same type as field does.
//set int value of "intField" field
int intValue=0;
entity.Set("intField", intValue);

Additional API

Method/Property Returns Description
Id BGId Get entity id
//get entity id
BGId id = entity.Id;
Index int Get entity physical position
//get entity index
int index = entity.Index;
Name string Get table row name. Name is special field of type string. You can also access it by calling entity.Get<string>("name");
//get entity name
string name = entity.Name;
Meta BGMetaEntity Get the table, this row belongs to
//get entity Meta
BGMetaEntity meta = entity.Meta;
IsDeleted bool was the entity deleted or unloaded
Delete() void Delete the row. Do not use this method to delete several rows, because it's way too slow for this. Use BGMetaEntity.DeleteEntities instead (make sure you use version >= 1.9.2)
//delete entity
entity.Delete();
Duplicate BGEntity duplicate the entity
CopyFieldsValuesFrom void copy field values from another entity
ClearFieldValue(BGId fieldId) void clear field value