예제 #1
0
        static void RegisterRoute(HttpRouteCollection routes)
        {
            routes.MapHttpRoute(
                "get receipt",
                "receipt",
                new
                {
                    controller = "Receipt",
                    action = "BuildReceipt"
                },
                new
                {
                    httpMethod = new HttpMethodConstraint(HttpMethod.Post)
                });

            routes.MapHttpRoute(
                "create promotions",
                "promotions/{promotionType}",
                new
                {
                    controller = "Promotion",
                    action = "CreatePromotion"
                },
                new
                {
                    httpMethod = new HttpMethodConstraint(HttpMethod.Post)
                });

            routes.MapHttpRoute(
                "get promotion barcodes",
                "promotions/{promotionType}",
                new
                {
                    controller = "Promotion",
                    action = "GetPromotion"
                },
                new
                {
                    httpMethod = new HttpMethodConstraint(HttpMethod.Get)
                });

            routes.MapRoute(
                "promotions/{promotionType}",
                "Promotion",
                "DeletePromotion",
                HttpMethod.Delete);
        }