Пример #1
0
 // 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();
 }
Пример #2
0
 public ActionResult SelectReader(ReaderType type)
 {
     var factory = new ReaderFactory();
     var reader = factory.CreateReader(type);
     //reader
     return null;
 }
Пример #3
0
 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;
 }