March 2018
Beginner to intermediate
410 pages
10h 40m
English
To plot historical values, we first need to read them from the database. We can use the Find<T>() method on the static Database class to find, filter, and sort objects in the database. It returns an enumerable set of objects of type T (IEnumerable<T>). We want to plot all values that are available, so we don't filter them. However, we want to get them in time order. To accessing the values from the script easier, we also convert our enumerable set of objects to an array. Database access is asynchronous, so we make our method asynchronous too:
public static async Task<LastMinute[]> GetLastMinutesAsync() { List<LastMinute> Result = new List<LastMinute>(); foreach (LastMinute Rec in await Database.Find<LastMinute>("Timestamp")) ...Read now
Unlock full access