Exemplo n.º 1
0
        public JsonResult AddMovie(int movieId, int?orderId = null)
        {
            int oId = 0;

            if (orderId.HasValue)
            {
                oId = orderId.Value;
            }
            else
            {
                var order = _ordersRepo.CreateOrder();
                oId = order.Id;
            }
            var movieOrder = _ordersRepo.AddMovie(oId, movieId);

            return(Json(movieOrder, JsonRequestBehavior.AllowGet));
        }