public CardHistoryEntry[] GetHistory(int cardID) { List <CardHistoryEntry> historyEntries = new List <CardHistoryEntry>(); string getHistoryQuery = string.Format("select * from CardHistories where Card='{0}'", cardID); SQLiteDataReader dataReader = ExecuteReaderQuery(getHistoryQuery); while (dataReader.Read()) { DateTime dateTime = new DateTime(Convert.ToInt64(dataReader["DateTime"])); TrialPerformance trialPerformance = (TrialPerformance)Convert.ToInt32(dataReader["Success"]); var historyEntry = new CardHistoryEntry(dateTime, trialPerformance); historyEntries.Add(historyEntry); } return(historyEntries.ToArray()); }
public void AddHistoryEntry(TrialPerformance trialPerformance) // TODO Violating SRP? Move history management to another class? { var entry = new CardHistoryEntry(DateTime.Now, trialPerformance); HistoryEntries.Add(entry); }