public ListModel GetSingle(string listType, int foodId) { try { List list = null; switch (listType) { case "missing": list = new Missing(); break; case "shopping": list = new Shopping(); break; } return(list.GetSingle(foodId)); } catch (Exception e) { throw new Exception(e.Message); } }