BGRepo API

BGRepo.cs - is a database itself. use BGRepo.I to get access to default database. The API list is not full.

Main API

Method/Property Returns Description
I BGRepo Get access to database (static property)
//get access to database
var repo = BGRepo.I;
this[string name] BGMetaEntity Get table by name
//get table named MyTable
var meta = repo["MyTable"];
this[BGId id] BGMetaEntity Get table by id
//get table with id
var meta = repo[new BGId("HThOdRCxlEGU1aefSG+Nbw")];

Additional API

Method/Property Returns Description
ForEachMeta(Action<BGMetaEntity> action) void Execute action for each table
//print every table name
repo.ForEachMeta(meta => Debug.Log(meta.Name));
ForEachMeta(Action<BGMetaEntity> action, Predicate<BGMetaEntity> filter) void Execute action for each table, which comply to the filter
//print every table name, which name starts with My
repo.ForEachMeta(meta => Debug.Log(meta.Name),
                meta => meta.Name.StartsWith("My"));
CountMeta int Number of tables
//print the number of tables
Debug.Log(repo.CountMeta);