/// <summary> /// Fetches all possible hulls /// </summary> /// <param name="output"></param> /// <returns></returns> public static bool FetchAll(ref List <Hull> output) { output = new List <Hull>(); SQLiteDataReader reader = DBI.DoQuery( "SELECT * FROM Hull ORDER BY ordering ASC;"); while (reader != null && reader.Read()) { Hull h = Hull.Factory(reader); output.Add(h); } return(true); }
/// <summary> /// Fetches a hull by ID /// </summary> /// <param name="output"></param> /// <param name="id"></param> /// <returns></returns> public static bool FetchById(ref Hull output, int id) { SQLiteDataReader reader = DBI.DoPreparedQuery( @"SELECT * FROM Hull WHERE id = @id LIMIT 1;" , new Tuple <string, object>("@id", id)); if (reader != null && reader.Read()) { output = Hull.Factory(reader); return(true); } return(false); }