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 table row id
//get entity id
BGId id = entity.Id;
Index int Get table row 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;
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
//delete entity
entity.Delete();