Skip to content

Instantly share code, notes, and snippets.

@ajtrujillo
Created March 13, 2017 00:02
Show Gist options
  • Save ajtrujillo/9c7808f84baca329b0d1fbb16a3a3109 to your computer and use it in GitHub Desktop.
Save ajtrujillo/9c7808f84baca329b0d1fbb16a3a3109 to your computer and use it in GitHub Desktop.
FindbyValue Solution (TechJobsConsole)
/*Enable user Search by any value in the table, without duplicates*/
public static List<Dictionary<string, string>> FindbyValue(string searchTerm)
{
LoadData();
List<Dictionary<string, string>> jobs = new List<Dictionary<string, string>>();
foreach (Dictionary<string, string> row in AllJobs)
foreach(KeyValuePair<string,string> kvp in row)
{
string aValue = kvp.Value.ToUpper();
if (aValue.Contains(searchTerm))
{
jobs.Add(row);
break;
}
}
return jobs;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment