Class Table<T>
Typed table used by Database.
Inherited Members
Namespace: GGL.DB
Assembly: GGL.dll
Syntax
public class Table<T> : Table where T : Data
Type Parameters
Name | Description |
---|---|
T | Type that extends Data. This will be the type of the data contained and serialized by the table. |
Constructors
| Edit this page View SourceTable(params T[])
Declaration
public Table(params T[] baseData)
Parameters
Type | Name | Description |
---|---|---|
T[] | baseData | Typed table used by . |
Properties
| Edit this page View SourcePath
Declaration
protected static string Path { get; }
Property Value
Type | Description |
---|---|
string | Path of the saved table in local storage. |
Methods
| Edit this page View SourceInsert(params T[])
Insert data in table.
Declaration
public void Insert(params T[] data)
Parameters
Type | Name | Description |
---|---|---|
T[] | data |
Remarks
IDs may change while inserting.
Load()
Restore in cache the data from the local storage.
Declaration
public override void Load()
Overrides
| Edit this page View SourceSave()
Write the content of the table to local storage.
Declaration
public override void Save()
Overrides
| Edit this page View SourceSelect(ulong)
Select an item by ID.
Declaration
public T Select(ulong id)
Parameters
Type | Name | Description |
---|---|---|
ulong | id | row ID |
Returns
Type | Description |
---|---|
T | Typed data |
Select(params ulong[])
Select a list of items. No params will return all data.
Declaration
public IEnumerable<T> Select(params ulong[] ids)
Parameters
Type | Name | Description |
---|---|---|
ulong[] | ids | row IDs |
Returns
Type | Description |
---|---|
IEnumerable<T> | Typed data |