Created
March 13, 2017 00:02
-
-
Save ajtrujillo/9c7808f84baca329b0d1fbb16a3a3109 to your computer and use it in GitHub Desktop.
FindbyValue Solution (TechJobsConsole)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*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