// GET: Home public ActionResult Index() { var factory = new ReaderFactory(); var reader = factory.CreateReader(ReaderType.XML); var menuItems = reader.Read(Server.MapPath("~/Content/FoodItemData")); return View(); }
public ActionResult SelectReader(ReaderType type) { var factory = new ReaderFactory(); var reader = factory.CreateReader(type); //reader return null; }
public IMenuReader GetMenuReader(string country) { var factory = new ReaderFactory(); IMenuReader reader = null; switch (country) { case "US": reader = factory.CreateReader(ReaderType.JSON); break; case "GB": reader = factory.CreateReader(ReaderType.XML); break; } return reader; }