コード例 #1
0
 public static Models.PresetPizzas MapPresetPizza(PresetPizza pizza)
 {
     return(new Models.PresetPizzas
     {
         PresetId = pizza.PresetId,
         PresetName = pizza.PresetName
     });
 }
コード例 #2
0
        public IActionResult PresetPizzaSelected(PresetPizza presetPizza)
        {
            var pizzaType    = client.GetAllPresetPizzas().FirstOrDefault(s => s.ID == presetPizza.ID);
            var sessionOrder = Utils.GetCurrentOrder(HttpContext.Session);

            sessionOrder.Pizzas.Add(new Pizza());
            var currentPizza = sessionOrder.Pizzas.Last();

            currentPizza.PresetPizza = pizzaType;
            currentPizza.Toppings    = pizzaType.Toppings;

            Utils.SaveOrder(HttpContext.Session, sessionOrder);


            return(RedirectToAction("GetSize"));
        }
コード例 #3
0
        public void Test_GetPresetPizzaById()
        {
            PresetPizza sut = presetpizzarepository.GetPresetPizzaById(2);

            Assert.Equal(sut.Name, "Meaty");
        }