本文整理汇总了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());
}
示例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());
}
示例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));
}
示例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());
}
示例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());
}
示例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=="));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例11: GridOrderTest
public void GridOrderTest()
{
string url = "/Order/Grid";
var routeCollection = new RouteCollection();
RouteConfig.RegisterRoutes(routeCollection);
routeCollection.ShouldMap(url).To<OrdersGridController>(c => c.Index());
}
示例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));
}
示例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());
}
示例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==="));
}
示例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());
}