当前位置: 首页>>代码示例>>C#>>正文


C# RouteCollection.ShouldMap方法代码示例

本文整理汇总了C#中RouteCollection.ShouldMap方法的典型用法代码示例。如果您正苦于以下问题:C# RouteCollection.ShouldMap方法的具体用法?C# RouteCollection.ShouldMap怎么用?C# RouteCollection.ShouldMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RouteCollection的用法示例。


在下文中一共展示了RouteCollection.ShouldMap方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HomeHasRoutes

        public void HomeHasRoutes()
        {
            RouteCollection routes = new RouteCollection();
            RouteConfig.RegisterRoutes(routes);

            routes.ShouldMap("~/").To<WKeeper.WebUI.Controllers.HomeController>(x => x.Index());
            routes.ShouldMap("~/Home/Index").To<WKeeper.WebUI.Controllers.HomeController>(x => x.Index());
            routes.ShouldMap("/").From<WKeeper.WebUI.Controllers.HomeController>(x => x.Index());
        }
开发者ID:slootsky-oleg,项目名称:WKeeper,代码行数:9,代码来源:RouteTests.cs

示例2: AreaCatalogsHasRoutes

        public void AreaCatalogsHasRoutes()
        {
            RouteCollection routes = new RouteCollection();

            var areaRegistration = new CatalogsAreaRegistration();
            AreaRegistrationContext context = new AreaRegistrationContext(areaRegistration.AreaName, routes);
            areaRegistration.RegisterArea(context);

            RouteConfig.RegisterRoutes(routes);

            // INCOMING ROUTES
            routes.ShouldMap("~/Catalogs").To<WKeeper.WebUI.Areas.Catalogs.Controllers.HomeController>(x => x.Index());
            routes.ShouldMap("~/Catalogs/Home/Index").To<WKeeper.WebUI.Areas.Catalogs.Controllers.HomeController>(x => x.Index());

            routes.ShouldMap("~/Catalogs/Colors").To<ColorsController>(x => x.Index());
            routes.ShouldMap("~/Catalogs/Colors/Index").To<ColorsController>(x => x.Index());

            routes.ShouldMap("~/Catalogs/Materials").To<MaterialsController>(x => x.Index());
            routes.ShouldMap("~/Catalogs/Materials/Index").To<MaterialsController>(x => x.Index());

            // OUTGOING ROUTES
            routes.ShouldMap("/Catalogs").From<WKeeper.WebUI.Areas.Catalogs.Controllers.HomeController>(x => x.Index());

            routes.ShouldMap("/Catalogs/Colors").From<ColorsController>(x => x.Index());

            routes.ShouldMap("/Catalogs/Materials").From<MaterialsController>(x => x.Index());
        }
开发者ID:slootsky-oleg,项目名称:WKeeper,代码行数:27,代码来源:RouteTests.cs

示例3: AreaDocumentsHasRoutes

        public void AreaDocumentsHasRoutes()
        {
            RouteCollection routes = new RouteCollection();

            var areaRegistration = new DocumentsAreaRegistration();
            AreaRegistrationContext context = new AreaRegistrationContext(areaRegistration.AreaName, routes);
            areaRegistration.RegisterArea(context);

            RouteConfig.RegisterRoutes(routes);

            routes.ShouldMap("~/Documents").To<WKeeper.WebUI.Areas.Documents.Controllers.IncomesController>(x => x.Index());
            routes.ShouldMap("~/Documents/Incomes/Index").To<WKeeper.WebUI.Areas.Documents.Controllers.IncomesController>(x => x.Index());
            routes.ShouldMap("~/Documents/Incomes/Edit/1").To<WKeeper.WebUI.Areas.Documents.Controllers.IncomesController>(x => x.Edit(1));
            routes.ShouldMap("~/Documents/Incomes/Delete/1").To<WKeeper.WebUI.Areas.Documents.Controllers.IncomesController>(x => x.Delete(1));
        }
开发者ID:slootsky-oleg,项目名称:WKeeper,代码行数:15,代码来源:RouteTests.cs

示例4: TestRouteTrips

 public void TestRouteTrips()
 {
     const string Url = "/Trips/Index";
     var routeCollection = new RouteCollection();
     RouteConfig.RegisterRoutes(routeCollection);
     routeCollection.ShouldMap(Url).To<TripsController>(c => c.Index());
 }
开发者ID:ivanvasilev,项目名称:PickUp,代码行数:7,代码来源:TripsRouteTests.cs

示例5: TestAccountRegister

 public void TestAccountRegister()
 {
     const string Url = "/Account/Register";
     var routeCollection = new RouteCollection();
     RouteConfig.RegisterRoutes(routeCollection);
     routeCollection.ShouldMap(Url).To<AccountController>(c => c.Register());
 }
开发者ID:antonpopov,项目名称:Final-Project,代码行数:7,代码来源:AdvertisementsRouteTests.cs

示例6: TestRouteById

 public void TestRouteById()
 {
     const string Url = "/Joke/Mjc2NS4xMjMxMjMxMzEyMw==";
     var routeCollection = new RouteCollection();
     RouteConfig.RegisterRoutes(routeCollection);
     routeCollection.ShouldMap(Url).To<ArticlesController>(c => c.ById("Mjc2NS4xMjMxMjMxMzEyMw=="));
 }
开发者ID:dtopalov,项目名称:IReporter,代码行数:7,代码来源:ArticlesRouteTests.cs

示例7: MediaRouteDetailsShouldWorkCorrectly

 public void MediaRouteDetailsShouldWorkCorrectly()
 {
     string Url = string.Format("/Media/Image/{0}/{1}/{2}", username, guid, size);
     var routeCollection = new RouteCollection();
     RouteConfig.RegisterRoutes(routeCollection);
     routeCollection.ShouldMap(Url).To<ImageController>(c => c.Index(username, guid, size));
 }
开发者ID:simeonpp,项目名称:Trip-Destination,代码行数:7,代码来源:MediaRouteTests.cs

示例8: TripRouteDetailsShouldWorkCorrectlyWithoutSlug

 public void TripRouteDetailsShouldWorkCorrectlyWithoutSlug()
 {
     string Url = string.Format("/Trip/{0}", pageId);
     var routeCollection = new RouteCollection();
     RouteConfig.RegisterRoutes(routeCollection);
     routeCollection.ShouldMap(Url).To<TripController>(c => c.Details(pageId));
 }
开发者ID:simeonpp,项目名称:Trip-Destination,代码行数:7,代码来源:TripRouteTests.cs

示例9: AddOrderShouldBeOk

 public void AddOrderShouldBeOk()
 {
     string url = "/Order/Create/Add/";
     var routeCollection = new RouteCollection();
     RouteConfig.RegisterRoutes(routeCollection);
     routeCollection.ShouldMap(url).To<CreateOrderController>(c => c.Add(null));
 }
开发者ID:DimitarDKirov,项目名称:ServiceSystem,代码行数:7,代码来源:CreateOrdersRouteTests.cs

示例10: OutOrdersTestRouteDetails

 public void OutOrdersTestRouteDetails()
 {
     var routeCollection = new RouteCollection();
     const string Url = "/OutOrders/Details/1";
     RouteConfig.RegisterRoutes(routeCollection);
     routeCollection.ShouldMap(Url).To<OutOrdersController>(c => c.Details(1));
 }
开发者ID:petyodelta,项目名称:ASP-NET-MVC,代码行数:7,代码来源:OutOrdersRouteTests.cs

示例11: GridOrderTest

 public void GridOrderTest()
 {
     string url = "/Order/Grid";
     var routeCollection = new RouteCollection();
     RouteConfig.RegisterRoutes(routeCollection);
     routeCollection.ShouldMap(url).To<OrdersGridController>(c => c.Index());
 }
开发者ID:DimitarDKirov,项目名称:ServiceSystem,代码行数:7,代码来源:GridOrdersRouteTests.cs

示例12: TestRouteEdit

 public void TestRouteEdit()
 {
     const string Url = "/Edit/EditTrip/1";
     var routeCollection = new RouteCollection();
     RouteConfig.RegisterRoutes(routeCollection);
     routeCollection.ShouldMap(Url).To<EditController>(c => c.EditTrip(1));
 }
开发者ID:ivanvasilev,项目名称:PickUp,代码行数:7,代码来源:TripsRouteTests.cs

示例13: TestRouteLocations

 public void TestRouteLocations()
 {
     const string Url = "/Locations/GetAllLocations";
     var routeCollection = new RouteCollection();
     RouteConfig.RegisterRoutes(routeCollection);
     routeCollection.ShouldMap(Url).To<LocationsController>(c => c.GetAllLocations());
 }
开发者ID:ivanvasilev,项目名称:PickUp,代码行数:7,代码来源:TripsRouteTests.cs

示例14: TestRouteById

 public void TestRouteById()
 {
     const string Url = "/Trip/MTUuMTIzMTIzMTMxMjM===";
     var routeCollection = new RouteCollection();
     RouteConfig.RegisterRoutes(routeCollection);
     routeCollection.ShouldMap(Url).To<TripsController>(c => c.ById("MTUuMTIzMTIzMTMxMjM==="));
 }
开发者ID:ivanvasilev,项目名称:PickUp,代码行数:7,代码来源:TripsRouteTests.cs

示例15: TestMainPage

 public void TestMainPage()
 {
     string url = "Administration/Administration/Index";
     var routeCollection = new RouteCollection();
     RouteConfig.RegisterRoutes(routeCollection);
     routeCollection.ShouldMap(url).To<AdministrationController>(c => c.Index());
 }
开发者ID:DimitarDKirov,项目名称:ServiceSystem,代码行数:7,代码来源:AdministrationAreaRouteTest.cs


注:本文中的RouteCollection.ShouldMap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。