/// <summary> /// Gets a role by id /// </summary> /// <param name="output"></param> /// <param name="id"></param> /// <returns></returns> public static bool FetchById(ref HullRole output, int id) { SQLiteDataReader reader = DBI.DoPreparedQuery( @"SELECT * FROM HullRole WHERE id = @id LIMIT 1;" , new Tuple <string, object>("@id", id)); if (reader != null && reader.Read()) { output = HullRole.Factory(reader); return(true); } return(false); }
/// <summary> /// Gets a role by name /// </summary> /// <param name="output"></param> /// <param name="name"></param> /// <returns></returns> public static bool FetchByName(ref HullRole output, string name) { SQLiteDataReader reader = DBI.DoPreparedQuery( @"SELECT * FROM HullRole WHERE name = @name LIMIT 1;" , new Tuple <string, object>("@name", name)); if (reader != null && reader.Read()) { output = HullRole.Factory(reader); return(true); } return(false); }