コード例 #1
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;
 }
コード例 #2
0
 public ActionResult SelectReader(ReaderType type)
 {
     var factory = new ReaderFactory();
     var reader = factory.CreateReader(type);
     //reader
     return null;
 }
コード例 #3
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();
 }