public static List <ALittleAlliteration> GetCluesForTheme(string theme, int season = 0) { List <ALittleAlliteration> matchingPuzzles = new List <ALittleAlliteration>(); GoogleSheet sheet = new GoogleSheet() { GoogleSheetKey = ALittleAlliterationGoogleSheet }; string query = $"SELECT * WHERE H LIKE '%{theme}%'"; if (season == 1) { sheet.GoogleSheetKey = ALittleAlliterationSeasonOneGoogleSheet; query = $"SELECT * WHERE I LIKE '%{theme}%'"; } foreach (var result in sheet.ExecuteQuery(query)) { ALittleAlliteration aLittleAlliteration = new ALittleAlliteration(result, season); if (!string.IsNullOrWhiteSpace(aLittleAlliteration.Clue)) { matchingPuzzles.Add(aLittleAlliteration); } } return(matchingPuzzles); }
public List <ALittleAlliteration> FindPuzzle(string firstThreeLetters) { GoogleSheet sheet = new GoogleSheet() { GoogleSheetKey = ALittleAlliterationGoogleSheet }; string firstThreeLetters1 = firstThreeLetters.ToLower(); List <ALittleAlliteration> results = new List <ALittleAlliteration>(); foreach (var dictionary in sheet.ExecuteQuery($"SELECT * WHERE E = '{firstThreeLetters1}'")) { var aLittleAlliteration = new ALittleAlliteration(dictionary); if (string.IsNullOrWhiteSpace(aLittleAlliteration.TwitterUrl) && string.IsNullOrWhiteSpace(aLittleAlliteration.DatePosted) && !string.IsNullOrWhiteSpace(aLittleAlliteration.Clue)) { results.Add(aLittleAlliteration); } } return(results); }