private static string GetCardIdByName(string name) { string id; if (CardNames.TryGetValue(name, out id)) { return(id); } else { Console.WriteLine("No Card with such name found, you probably misspelled it."); return(null); // throw err } }