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
var 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
var intValue=0;
entity.Set("intField", intValue);

Additional API

Method/Property Returns Description
Id BGId Get table row id

//get entity id
var id = entity.Id;
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
var name = entity.Name;
Meta BGMetaEntity Get the table, this row belongs to
//get entity Meta
var meta = entity.Meta;
Delete() void Delete the row. Do not use this method to delete several rows, cause it's way too slow for this. Use BGMetaEntity.DeleteEntities instead

//delete entity
entity.Delete();