BGMetaEntity.cs -is a database table, containing 1-n fields and 0-n rows. The API list is not full.
Main API
| Method/Property | Returns | Description |
|---|---|---|
| this[int entityIndex] | BGEntity | Get table row by its index |
|
||
| this[BGId entityId] | BGEntity | Get table row by its id |
|
||
| this[string entityName] | BGEntity | Get the first table row, whose name is equal to entityName |
|
||
| ForEachEntity(Action<BGEntity> action, Predicate<BGEntity> filter=null, Comparison<BGEntity> sort=null) | void | Search and iterate entities by filter. For each found entity action will be called. Sort delegate allows to sort entities. This method is slow, especially if sort is provided |
|
||
| FindEntity(Predicate<BGEntity> filter) | BGEntity | Find the first entity by filter. This method is slow |
|
||
| FindEntities(Predicate<BGEntity> filter, List<BGEntity> result=null, Comparison<BGEntity> sort=null) | List<BGEntity> | Search entities by filter. Pass in 'result' list to get rid of Garbage Collection. 'sort' allows to sort entities. This method is slow, especially if sort is provided |
|
||
| CountEntities | int | The number of rows |
|
||
| NewEntity | BGEntity | Create new row |
|
||
Additional API
| Method/Property | Returns | Description |
|---|---|---|
| Id | BGId | table id |
|
||
| Name | string | table name |
|
||
| IsDeleted | bool | was the table deleted or unloaded |
| DeleteEntities | void | Delete several rows. This method is much faster for several rows, compared to BGEntity.Delete |
|
||
| SwapEntities | int | swap two rows |
| CountFields | int | get the number of fields |
| GetField | BGField | get the field by index/name/ID |
| FindField(Predicate<BGField> filter) | BGField | find the field by using predicate |
| ForEachField(Action<BGField> action) | void | Execute action for each field |
|
||
| ForEachField(Action<BGField> action, Predicate<BGField> filter = null) | void | Execute action for each field, complying to the filter |
|
||
| SwapFields | int | swap two fields |
| RelationsInboundNullable | List<BGAbstractRelationI> | get the list of incoming relations |
| CountKeys | int | get the number of keys |
| GetKey | BGKey | get the key by index/ID/name |
| CountIndexes | int | get the number of indexes |
| GetIndex | BGIndex | get the index by index/ID/name |