public static int Get(this Marking m, Dictionary<int, string> names, string name) { int idx = names.Where(x => x.Value == name).Select(x => x.Key).Single(); return (int)m[idx]; }