示例#1
0
        public IEnumerable <Combo> GetAllCombos()
        {
            var chickenLittleCombo = new ChickenLittleCombo(new MashedPotato(), new Brownie());
            var crispyColonelCombo = new CrispyColonelCombo(new MacAndCheese(), new Cookie());
            var kidMealCombo       = new KidMealCombo(new FrenchFry(), new IceCream());

            var listOfCombos = new List <Combo>();

            listOfCombos.Add(chickenLittleCombo);
            listOfCombos.Add(crispyColonelCombo);
            listOfCombos.Add(kidMealCombo);

            return(listOfCombos);
        }
示例#2
0
        public static async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequest request,
            ILogger log)
        {
            var orderId = Guid.NewGuid();

            log.LogInformation("Placing new order.");


            if (!request.IsJson())
            {
                return(new UnsupportedMediaTypeResult());
            }

            var kidsMeal     = new KidMealCombo(new FrenchFry(), new IceCream());
            var comboService = new ComboService();
            var newOrder     = comboService.PlaceOrderAsync(kidsMeal);

            return(new AcceptedResult()); //TODO: Should return 201 Created result
        }