Beispiel #1
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
        }