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