public static object GetRequiredObject(this RouteValueDictionary items, string key) { if (!items.Keys.Contains(key)) throw new ArgumentNullException("The " + key + " query string parameter was not found but is required"); return items[key]; }