private void ConfigureRoutes(IRouteBuilder routeBuilder) { // Route name, routing template to follow. // If we don't find a controller or action, use Home & Index, respectively, // as the defaults. The id is optional. routeBuilder.MapRoute("Default", "{controller=Home}/{action=Index}/{id?}"); }
//convention based routing private void ConfigureRoutes(IRouteBuilder routeBuilder) { // / // /Home/Index -- you want to reach the home controller and call the Index method routeBuilder.MapRoute("Default", "{controller=Home}/{action=Index}/{id?}"); }
public void ConfigureRoutes(IRouteBuilder builder) { builder.MapRoute( name: "BillingRoutes", template: "{controller}/{action}/{id?}", defaults: new {controller = "Contract", action="Index", area = "Itasu.Billing.Ui"}); }
public static void Configure(IRouteBuilder routes) { routes.MapRoute(name: "areaRoute", template: "{area:exists}/{controller}/{action?}/{id?}", defaults: new { controller = "Home", action = "Index" }); routes.MapRoute( name: "account", template: "Account/{action}/", defaults: new { controller = "Account" }); routes.MapRoute( name: "templates", template: "Templates/{action}/", defaults: new { controller = "Templates" }); routes.MapRoute( name: "defaultWithAction", template: "{controller}/{action?}/{id?}", defaults: new { controller = "Home", action = "Index" }); routes.MapRoute( name: "default", template: "{controller}/{*.}", defaults: new { controller = "Home", action = "Index" }); }
public override void Configure(IApplicationBuilder builder, IRouteBuilder routes, IServiceProvider serviceProvider) { routes.MapAreaRoute( name: "EditField", area: "Orchard.ContentTypes", template: "Admin/EditField/{id}/{name}", controller: "Admin", action: "EditField" ); routes.MapAreaRoute( name: "EditTypePart", area: "Orchard.ContentTypes", template: "Admin/Edit/{id}/{name}", controller: "Admin", action: "EditTypePart" ); routes.MapAreaRoute( name: "RemovePart", area: "Orchard.ContentTypes", template: "Admin/RemovePart/{id}/{name}", controller: "Admin", action: "RemovePart" ); }
private void ConfigureRoutes(IRouteBuilder routeBuilder) { routeBuilder.MapRoute( name: "Home", template: "", defaults: new { controller = "Home", action = "Index" }); routeBuilder.MapRoute( name: "registration", template: "registration", defaults: new {controller = "Registration", action = "Registration" }); routeBuilder.MapRoute( name: "login", template: "login", defaults: new {controller = "Login", action = "Login"}); routeBuilder.MapRoute( name: "default", template: "{controller}/{action}"); }
public RoutePublisher( IRouteBuilder routeBuilder, ShellSettings shellSettings) { _routeBuilder = routeBuilder; _shellSettings = shellSettings; }
/// <summary> /// default initialize from rpclite.config.json /// </summary> /// <param name="routers">used to UseMiddleware, keep null if not need set</param> public static void Initialize(IRouteBuilder routers) { var config = RpcInitializer.GetConfiguration(null); var rpcConfig = RpcConfigHelper.GetConfig(new CoreConfigurationSection(config)); Initialize(routers, rpcConfig); }
public bool DequeueFirstCallFromQueue(Queue queue, IRouteBuilder route) { var twilioClient = new TwilioRestClient(_accountSettings.AccountSid, _accountSettings.AuthToken); var result = twilioClient.DequeueFirstQueueMember(queue.Id, route.Url, route.Method); return result == DequeueStatus.Success; }
public override void Configure(IApplicationBuilder builder, IRouteBuilder routes, IServiceProvider serviceProvider) { routes.MapAreaRoute( name: "Home", area: "Orchard.Demo", template: "Home/Index", controller: "Home", action: "Index" ); routes.MapAreaRoute( name: "Display", area: "Orchard.Demo", template: "Home/Display/{id}", controller: "Home", action: "Display" ); routes.MapAreaRoute( name: "Error", area: "Orchard.Demo", template: "Home/IndexError", controller: "Home", action: "IndexError" ); builder.UseMiddleware<NonBlockingMiddleware>(); builder.UseMiddleware<BlockingMiddleware>(); }
private void ConfigureRoutes(IRouteBuilder config) { config.MapRoute( name: "Default", template: "{controller}/{action}/{id?}", defaults: new { controller = "Home", action = "Index" } ); }
public override void Configure(IApplicationBuilder builder, IRouteBuilder routes, IServiceProvider serviceProvider) { builder .UseCookieAuthentication(_options.Cookies.ApplicationCookie) .UseCookieAuthentication(_options.Cookies.ExternalCookie) .UseCookieAuthentication(_options.Cookies.TwoFactorRememberMeCookie) .UseCookieAuthentication(_options.Cookies.TwoFactorUserIdCookie) ; }
public static IRouteBuilder Setup(IRouteBuilder routes) { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}" ); return routes; }
public override void Configure(IApplicationBuilder builder, IRouteBuilder routes, IServiceProvider serviceProvider) { routes.MapAreaRoute( name: "Admin", area: "Orchard.Admin", template: "admin", controller: "Admin", action: "Index" ); }
public static void Configure(IRouteBuilder routeBuilder) { routeBuilder.MapRoute( name: "Default", template: "{controller}/{action}/{id?}", defaults: new { controller = "Home", action = "Index" }); routeBuilder.MapRoute("Views_Durandal", "views/{controller}/{action}.html"); }
public void ConfigureRoutes(IRouteBuilder builder) { builder.MapRoute( name: "Settings", template: "Admin/Settings/General/{action=Index}", defaults: new { controller = "Settings", area = "Itasu.Core" }); builder.MapRoute( name: "AdminDefault", template: "Admin/{area=Itasu.Core}/{controller=Dashboard}/{action=Index}"); }
/// <summary> /// /// </summary> /// <param name="routers"></param> /// <param name="rpcConfig"></param> public static void Initialize(IRouteBuilder routers, RpcConfig rpcConfig) { RpcManager.Initialize(rpcConfig); if (rpcConfig?.Service?.Paths != null) { foreach (var path in rpcConfig.Service.Paths) { routers.MapRoute(path, context => RpcManager.ProcessAsync(new AspNetCoreServerContext(context))); } } }
public void ConfigureRoutes(IRouteBuilder builder) { builder.MapRoute( name: "Account", template: "account/{action}", defaults: new {controller = "Account", area = "Itasu.Extensions.Identity" }); builder.MapRoute( name: "Identity", template: "Admin/Identity/{controller=Users}/{action=Index}/{id?}", defaults: new {area = "Itasu.Extensions.Identity"}); }
public void ConfigureRoutes(IRouteBuilder builder) { builder.MapRoute( name: "NavigationAdmin", template: "Admin/Navigation/{controller=Menu}/{action=Index}/{id?}", defaults: new { area = "Itasu.Extensions.Navigation" }); builder.MapRoute( name: null, template: "Admin/Navigation/{controller=Menu}/{action=Index}/{menuId?}", defaults: new {area = "Itasu.Extensions.Navigation"}); }
public void ConfigureRoutes(IRouteBuilder builder) { builder.MapRoute( name: "PagesAdmin", template: "Admin/Pages/{action=Index}/{id?}", defaults: new {controller = "Admin", area = "Itasu.Extensions.Pages"}); builder.MapRoute( name: "Pages", template: "Pages/{name}", defaults: new { controller = "Page", action = "DisplayPage", area = "Itasu.Extensions.Pages" }); builder.MapRoute( name: "PagePermalink", template: "{*permalink}", defaults: new {controller = "Page", action = "DisplayPage", area = "Itasu.Extensions.Pages"}, constraints: new {permalink = new PermalinkRouteConstraint()}); }
public override void Configure(IApplicationBuilder builder, IRouteBuilder routes, IServiceProvider serviceProvider) { routes.MapAreaRoute( name: "DisplayContent", area: "Orchard.Contents", template: "Contents/Item/Display/{id}", controller: "Item", action: "Display" ); routes.MapAreaRoute( name: "PreviewContent", area: "Orchard.Contents", template: "Contents/Item/Preview/{id}", controller: "Item", action: "Preview" ); }
public void Build(IEndpoint endpoint, IRouteBuilder builder) { if (methodNameMethod.ContainsKey(endpoint.Method.Name)) builder.RestrictMethods(methodNameMethod[endpoint.Method.Name]); var namespacePart = (endpoint.HandlerType.Namespace ?? string.Empty).Split('.').LastOrDefault(); if (!string.IsNullOrEmpty(namespacePart) && !namespacePartsToIgnore.Contains(namespacePart)) builder.Append(namespacePart.ToLower()); if (!handlerNamesToIgnore.Contains(endpoint.HandlerType.Name)) builder.Append(endpoint.HandlerType.Name.ToLower()); var input = endpoint.Method.GetParameters().FirstOrDefault(); if (input == null) return; var inputParameters = input.ParameterType.GetProperties(); foreach (var parameter in inputParameters) { builder.AppendParameter(new RouteParameter(parameter)); } }
public static ODataQueryOptions <T> GetODataQueryOptions <T>(string queryString, IServiceProvider serviceProvider, IRouteBuilder routeBuilder) where T : class { ODataConventionModelBuilder builder = new ODataConventionModelBuilder(serviceProvider); builder.EntitySet <T>(typeof(T).Name); builder.EnableLowerCamelCase(); IEdmModel model = builder.GetEdmModel(); IEdmEntitySet entitySet = model.EntityContainer.FindEntitySet(typeof(T).Name); ODataPath path = new ODataPath(new Microsoft.OData.UriParser.EntitySetSegment(entitySet)); routeBuilder.EnableDependencyInjection(); return(new ODataQueryOptions <T> ( new ODataQueryContext(model, typeof(T), path), BuildRequest ( new DefaultHttpContext() { RequestServices = serviceProvider }.Request, new Uri(BASEADDRESS + queryString) ) ));
/// <summary> /// Adds the POP Forums routes to the application. /// </summary> /// <param name="routes"></param> /// <param name="app"></param> /// <returns></returns> public static IRouteBuilder AddPopForumsRoutes(this IRouteBuilder routes, IApplicationBuilder app) { routes.MapRoute( "pfsetup", "Forums/Setup", new { controller = "Setup", action = "Index", Area = "Forums" } ); var setupService = app.ApplicationServices.GetService <ISetupService>(); if (!setupService.IsConnectionPossible() || !setupService.IsDatabaseSetup()) { return(routes); } routes.MapRoute( "pfrecent", "Forums/Recent/{pageNumber?}", new { controller = ForumController.Name, action = "Recent", pageNumber = 1, Area = "Forums" } ); var forumRepository = app.ApplicationServices.GetService <IForumRepository>(); var forumConstraint = new ForumRouteConstraint(forumRepository); routes.MapRoute( "pfroot", "Forums/{urlName}/{pageNumber?}", new { controller = ForumController.Name, action = "Index", pageNumber = 1, Area = "Forums" }, new { forum = forumConstraint } ); routes.MapRoute( "pftopic", "Forums/Topic/{id}/{pageNumber?}", new { controller = ForumController.Name, action = "Topic", pageNumber = 1, Area = "Forums" } ); routes.MapRoute( "pflink", "Forums/PostLink/{id}", new { controller = ForumController.Name, action = "PostLink", Area = "Forums" } ); routes.MapRoute( "pfsubtopics", "Forums/Subscription/Topics/{pageNumber?}", new { controller = SubscriptionController.Name, action = "Topics", pageNumber = 1, Area = "Forums" } ); routes.MapRoute( "pffavetopics", "Forums/Favorites/Topics/{pageNumber?}", new { controller = FavoritesController.Name, action = "Topics", pageNumber = 1, Area = "Forums" } ); routes.MapRoute( "pfpagedusertopics", "Forums/Account/Posts/{id}/{pageNumber?}", new { controller = AccountController.Name, action = "Posts", pageNumber = 1, Area = "Forums" } ); routes.MapRoute( "pftopicunsub", "Forums/Subscription/Unsubscribe/{topicID}/{authKey}", new { controller = SubscriptionController.Name, action = "Unsubscribe", Area = "Forums" } ); routes.MapRoute( "pfadmin", "Forums/Admin/{**app}", new { controller = AdminController.Name, action = "App", Area = "Forums" }); return(routes); }
/// <summary> /// 設定Mvc路由,此方法在執行階段被呼叫,使用此方法設定MVC預設路由規則 /// </summary> /// <param name="routes">路由建構器</param> public void ConfigureMvcRoute(IRouteBuilder routes) { //取得所有路由規則 var rules = Configuration.GetSection("MvcRoutingRules")?.GetChildren(); //未設定則跳脫 if (rules == null) return; //註冊所有路由規則 foreach (var rule in rules) { //取得子屬性集合 var attributes = rule.GetChildren(); //註冊路由 routes.MapRoute( name: attributes.Where(item => item.Key == "Name").FirstOrDefault()?.Value, template: attributes.Where(item => item.Key == "Template").FirstOrDefault()?.Value, defaults: attributes.Where(item => item.Key == "Defaults").FirstOrDefault()?.ToDynamicObject(), constraints: attributes.Where(item => item.Key == "Constraints").FirstOrDefault()?.ToDynamicObject(), dataTokens: attributes.Where(item => item.Key == "DataTokens").FirstOrDefault()?.ToDynamicObject() ); } }
public Navigator(IRouteBuilder routeBuilder) { this.routeBuilder = routeBuilder; }
public void RegisterRoute(IRouteBuilder routes) { }
/// <summary> /// Adds a route to the route builder with the specified name, template, default values, and constraints. /// </summary> /// <param name="routeBuilder">The route builder to add the route to</param> /// <param name="name">The name of the route</param> /// <param name="template">The URL pattern of the route</param> /// <param name="defaults"> An object that contains default values for route parameters. /// The object's properties represent the names and values of the default values</param> /// <param name="constraints">An object that contains constraints for the route. /// The object's properties represent the names and values of the constraints</param> /// <returns>Route builder</returns> public static IRouteBuilder MapLocalizedRoute(this IRouteBuilder routeBuilder, string name, string template, object defaults, object constraints) { return(MapLocalizedRoute(routeBuilder, name, template, defaults, constraints, dataTokens: null)); }
public ViewRouterProxy(IRouteBuilder routeBuilder) { _routeBuilder = routeBuilder; _router = new Lazy <ViewRouterDelegate>(BuildRouter); }
private void ConfigRoutes(IRouteBuilder routes) { routes.MapRoute("Default", "{__tenant__=}/{controller=Home}/{action=Index}"); }
/// <summary> /// Adds a route to the route builder with the specified name and template /// </summary> /// <param name="routeBuilder">The route builder to add the route to</param> /// <param name="name">The name of the route</param> /// <param name="template">The URL pattern of the route</param> /// <returns>Route builder</returns> public static IRouteBuilder MapLocalizedRoute(this IRouteBuilder routeBuilder, string name, string template) { return(MapLocalizedRoute(routeBuilder, name, template, defaults: null)); }
public static IRouteBuilder UseCustomRoutes(this IRouteBuilder routes, bool useFolders) { routes.AddCloudscribeFileManagerRoutes(); if (useFolders) { routes.MapRoute( name: "foldererrorhandler", template: "{sitefolder}/oops/error/{statusCode?}", defaults: new { controller = "Oops", action = "Error" }, constraints: new { name = new cloudscribe.Core.Web.Components.SiteFolderRouteConstraint() } ); routes.MapRoute( name: "apifoldersitemap", template: "{sitefolder}/api/sitemap" , defaults: new { controller = "FolderSiteMap", action = "Index" } , constraints: new { name = new cloudscribe.Core.Web.Components.SiteFolderRouteConstraint() } ); routes.MapRoute( name: "folderdefault", template: "{sitefolder}/{controller}/{action}/{id?}", defaults: new { controller = "Home", action = "Index" }, constraints: new { sitefolder = new cloudscribe.Core.Web.Components.SiteFolderRouteConstraint() }); } routes.MapRoute( name: "stateautosuggest", template: "coredata/stateautosuggestjson", defaults: new { controller = "CoreDaata", action = "StateAutoSuggestJson" } ); routes.MapRoute( name: "errorhandler", template: "oops/error/{statusCode?}", defaults: new { controller = "Oops", action = "Error" } ); //routes.MapRoute( // name: "systlog", // template: "systemlog/{action=Index}" // //, defaults: new { action = "Index" } // ); //routes.MapRoute( // name: "predefault", // template: "{controller}/{action}" // , defaults: new { action = "Index" } // ); routes.MapRoute( name: "default", template: "{controller}/{action}" , defaults: new { controller = "Home", action = "Index" } ); return(routes); }
public void Configure(IRouteBuilder routeBuilder) { }
/// <summary> /// Register routes /// </summary> /// <param name="routeBuilder">Route builder</param> public void RegisterRoutes(IRouteBuilder routeBuilder) { //reorder routes so the most used ones are on top. It can improve performance //areas routeBuilder.MapRoute(name: "areaRoute", template: "{area:exists}/{controller=Home}/{action=Index}/{id?}"); //home page routeBuilder.MapLocalizedRoute("HomePage", "", new { controller = "Home", action = "Index" }); //login routeBuilder.MapLocalizedRoute("Login", "login/", new { controller = "Customer", action = "Login" }); //register routeBuilder.MapLocalizedRoute("Register", "register/", new { controller = "Customer", action = "Register" }); //logout routeBuilder.MapLocalizedRoute("Logout", "logout/", new { controller = "Customer", action = "Logout" }); //shopping cart routeBuilder.MapLocalizedRoute("ShoppingCart", "cart/", new { controller = "ShoppingCart", action = "Cart" }); //estimate shipping routeBuilder.MapLocalizedRoute("EstimateShipping", "cart/estimateshipping", new { controller = "ShoppingCart", action = "GetEstimateShipping" }); //wishlist routeBuilder.MapLocalizedRoute("Wishlist", "wishlist/{customerGuid?}", new { controller = "ShoppingCart", action = "Wishlist" }); //customer account links routeBuilder.MapLocalizedRoute("CustomerInfo", "customer/info", new { controller = "Customer", action = "Info" }); routeBuilder.MapLocalizedRoute("CustomerAddresses", "customer/addresses", new { controller = "Customer", action = "Addresses" }); routeBuilder.MapLocalizedRoute("CustomerOrders", "order/history", new { controller = "Order", action = "CustomerOrders" }); //contact us routeBuilder.MapLocalizedRoute("ContactUs", "contactus", new { controller = "Common", action = "ContactUs" }); //sitemap routeBuilder.MapLocalizedRoute("Sitemap", "sitemap", new { controller = "Common", action = "Sitemap" }); //product search routeBuilder.MapLocalizedRoute("ProductSearch", "search/", new { controller = "Catalog", action = "Search" }); routeBuilder.MapLocalizedRoute("ProductSearchAutoComplete", "catalog/searchtermautocomplete", new { controller = "Catalog", action = "SearchTermAutoComplete" }); //change currency (AJAX link) routeBuilder.MapLocalizedRoute("ChangeCurrency", "changecurrency/{customercurrency:min(0)}", new { controller = "Common", action = "SetCurrency" }); //change language (AJAX link) routeBuilder.MapLocalizedRoute("ChangeLanguage", "changelanguage/{langid:min(0)}", new { controller = "Common", action = "SetLanguage" }); //change tax (AJAX link) routeBuilder.MapLocalizedRoute("ChangeTaxType", "changetaxtype/{customertaxtype:min(0)}", new { controller = "Common", action = "SetTaxType" }); //recently viewed products routeBuilder.MapLocalizedRoute("RecentlyViewedProducts", "recentlyviewedproducts/", new { controller = "Product", action = "RecentlyViewedProducts" }); //new products routeBuilder.MapLocalizedRoute("NewProducts", "newproducts/", new { controller = "Product", action = "NewProducts" }); //blog routeBuilder.MapLocalizedRoute("Blog", "blog", new { controller = "Blog", action = "List" }); //news routeBuilder.MapLocalizedRoute("NewsArchive", "news", new { controller = "News", action = "List" }); //forum routeBuilder.MapLocalizedRoute("Boards", "boards", new { controller = "Boards", action = "Index" }); //compare products routeBuilder.MapLocalizedRoute("CompareProducts", "compareproducts/", new { controller = "Product", action = "CompareProducts" }); //product tags routeBuilder.MapLocalizedRoute("ProductTagsAll", "producttag/all/", new { controller = "Catalog", action = "ProductTagsAll" }); //manufacturers routeBuilder.MapLocalizedRoute("ManufacturerList", "manufacturer/all/", new { controller = "Catalog", action = "ManufacturerAll" }); //vendors routeBuilder.MapLocalizedRoute("VendorList", "vendor/all/", new { controller = "Catalog", action = "VendorAll" }); //add product to cart (without any attributes and options). used on catalog pages. routeBuilder.MapLocalizedRoute("AddProductToCart-Catalog", "addproducttocart/catalog/{productId:min(0)}/{shoppingCartTypeId:min(0)}/{quantity:min(0)}", new { controller = "ShoppingCart", action = "AddProductToCart_Catalog" }); //add product to cart (with attributes and options). used on the product details pages. routeBuilder.MapLocalizedRoute("AddProductToCart-Details", "addproducttocart/details/{productId:min(0)}/{shoppingCartTypeId:min(0)}", new { controller = "ShoppingCart", action = "AddProductToCart_Details" }); //comparing products routeBuilder.MapLocalizedRoute("AddProductToCompare", "compareproducts/add/{productId:min(0)}", new { controller = "Product", action = "AddProductToCompareList" }); //product email a friend routeBuilder.MapLocalizedRoute("ProductEmailAFriend", "productemailafriend/{productId:min(0)}", new { controller = "Product", action = "ProductEmailAFriend" }); //reviews routeBuilder.MapLocalizedRoute("ProductReviews", "productreviews/{productId}", new { controller = "Product", action = "ProductReviews" }); routeBuilder.MapLocalizedRoute("CustomerProductReviews", "customer/productreviews", new { controller = "Product", action = "CustomerProductReviews" }); routeBuilder.MapLocalizedRoute("CustomerProductReviewsPaged", "customer/productreviews/page/{pageNumber:min(0)}", new { controller = "Product", action = "CustomerProductReviews" }); //back in stock notifications routeBuilder.MapLocalizedRoute("BackInStockSubscribePopup", "backinstocksubscribe/{productId:min(0)}", new { controller = "BackInStockSubscription", action = "SubscribePopup" }); routeBuilder.MapLocalizedRoute("BackInStockSubscribeSend", "backinstocksubscribesend/{productId:min(0)}", new { controller = "BackInStockSubscription", action = "SubscribePopupPOST" }); //downloads routeBuilder.MapRoute("GetSampleDownload", "download/sample/{productid:min(0)}", new { controller = "Download", action = "Sample" }); //checkout pages routeBuilder.MapLocalizedRoute("Checkout", "checkout/", new { controller = "Checkout", action = "Index" }); routeBuilder.MapLocalizedRoute("CheckoutOnePage", "onepagecheckout/", new { controller = "Checkout", action = "OnePageCheckout" }); routeBuilder.MapLocalizedRoute("CheckoutShippingAddress", "checkout/shippingaddress", new { controller = "Checkout", action = "ShippingAddress" }); routeBuilder.MapLocalizedRoute("CheckoutSelectShippingAddress", "checkout/selectshippingaddress", new { controller = "Checkout", action = "SelectShippingAddress" }); routeBuilder.MapLocalizedRoute("CheckoutBillingAddress", "checkout/billingaddress", new { controller = "Checkout", action = "BillingAddress" }); routeBuilder.MapLocalizedRoute("CheckoutSelectBillingAddress", "checkout/selectbillingaddress", new { controller = "Checkout", action = "SelectBillingAddress" }); routeBuilder.MapLocalizedRoute("CheckoutShippingMethod", "checkout/shippingmethod", new { controller = "Checkout", action = "ShippingMethod" }); routeBuilder.MapLocalizedRoute("CheckoutPaymentMethod", "checkout/paymentmethod", new { controller = "Checkout", action = "PaymentMethod" }); routeBuilder.MapLocalizedRoute("CheckoutPaymentInfo", "checkout/paymentinfo", new { controller = "Checkout", action = "PaymentInfo" }); routeBuilder.MapLocalizedRoute("CheckoutConfirm", "checkout/confirm", new { controller = "Checkout", action = "Confirm" }); routeBuilder.MapLocalizedRoute("CheckoutCompleted", "checkout/completed/{orderId:regex(\\d*)}", new { controller = "Checkout", action = "Completed" }); //subscribe newsletters routeBuilder.MapLocalizedRoute("SubscribeNewsletter", "subscribenewsletter", new { controller = "Newsletter", action = "SubscribeNewsletter" }); //email wishlist routeBuilder.MapLocalizedRoute("EmailWishlist", "emailwishlist", new { controller = "ShoppingCart", action = "EmailWishlist" }); //login page for checkout as guest routeBuilder.MapLocalizedRoute("LoginCheckoutAsGuest", "login/checkoutasguest", new { controller = "Customer", action = "Login", checkoutAsGuest = true }); //register result page routeBuilder.MapLocalizedRoute("RegisterResult", "registerresult/{resultId:min(0)}", new { controller = "Customer", action = "RegisterResult" }); //check username availability routeBuilder.MapLocalizedRoute("CheckUsernameAvailability", "customer/checkusernameavailability", new { controller = "Customer", action = "CheckUsernameAvailability" }); //passwordrecovery routeBuilder.MapLocalizedRoute("PasswordRecovery", "passwordrecovery", new { controller = "Customer", action = "PasswordRecovery" }); //password recovery confirmation routeBuilder.MapLocalizedRoute("PasswordRecoveryConfirm", "passwordrecovery/confirm", new { controller = "Customer", action = "PasswordRecoveryConfirm" }); //topics routeBuilder.MapLocalizedRoute("TopicPopup", "t-popup/{SystemName}", new { controller = "Topic", action = "TopicDetailsPopup" }); //blog routeBuilder.MapLocalizedRoute("BlogByTag", "blog/tag/{tag}", new { controller = "Blog", action = "BlogByTag" }); routeBuilder.MapLocalizedRoute("BlogByMonth", "blog/month/{month}", new { controller = "Blog", action = "BlogByMonth" }); //blog RSS routeBuilder.MapLocalizedRoute("BlogRSS", "blog/rss/{languageId:min(0)}", new { controller = "Blog", action = "ListRss" }); //news RSS routeBuilder.MapLocalizedRoute("NewsRSS", "news/rss/{languageId:min(0)}", new { controller = "News", action = "ListRss" }); //set review helpfulness (AJAX link) routeBuilder.MapRoute("SetProductReviewHelpfulness", "setproductreviewhelpfulness", new { controller = "Product", action = "SetProductReviewHelpfulness" }); //customer account links routeBuilder.MapLocalizedRoute("CustomerReturnRequests", "returnrequest/history", new { controller = "ReturnRequest", action = "CustomerReturnRequests" }); routeBuilder.MapLocalizedRoute("CustomerDownloadableProducts", "customer/downloadableproducts", new { controller = "Customer", action = "DownloadableProducts" }); routeBuilder.MapLocalizedRoute("CustomerBackInStockSubscriptions", "backinstocksubscriptions/manage", new { controller = "BackInStockSubscription", action = "CustomerSubscriptions" }); routeBuilder.MapLocalizedRoute("CustomerBackInStockSubscriptionsPaged", "backinstocksubscriptions/manage/{pageNumber:regex(\\d*)}", new { controller = "BackInStockSubscription", action = "CustomerSubscriptions" }); routeBuilder.MapLocalizedRoute("CustomerRewardPoints", "rewardpoints/history", new { controller = "Order", action = "CustomerRewardPoints" }); routeBuilder.MapLocalizedRoute("CustomerRewardPointsPaged", "rewardpoints/history/page/{pageNumber:min(0)}", new { controller = "Order", action = "CustomerRewardPoints" }); routeBuilder.MapLocalizedRoute("CustomerChangePassword", "customer/changepassword", new { controller = "Customer", action = "ChangePassword" }); routeBuilder.MapLocalizedRoute("CustomerAvatar", "customer/avatar", new { controller = "Customer", action = "Avatar" }); routeBuilder.MapLocalizedRoute("AccountActivation", "customer/activation", new { controller = "Customer", action = "AccountActivation" }); routeBuilder.MapLocalizedRoute("EmailRevalidation", "customer/revalidateemail", new { controller = "Customer", action = "EmailRevalidation" }); routeBuilder.MapLocalizedRoute("CustomerForumSubscriptions", "boards/forumsubscriptions", new { controller = "Boards", action = "CustomerForumSubscriptions" }); routeBuilder.MapLocalizedRoute("CustomerForumSubscriptionsPaged", "boards/forumsubscriptions/{pageNumber:regex(\\d*)}", new { controller = "Boards", action = "CustomerForumSubscriptions" }); routeBuilder.MapLocalizedRoute("CustomerAddressEdit", "customer/addressedit/{addressId:min(0)}", new { controller = "Customer", action = "AddressEdit" }); routeBuilder.MapLocalizedRoute("CustomerAddressAdd", "customer/addressadd", new { controller = "Customer", action = "AddressAdd" }); //customer profile page routeBuilder.MapLocalizedRoute("CustomerProfile", "profile/{id:min(0)}", new { controller = "Profile", action = "Index" }); routeBuilder.MapLocalizedRoute("CustomerProfilePaged", "profile/{id}/page/{pageNumber:min(0)}", new { controller = "Profile", action = "Index" }); //orders routeBuilder.MapLocalizedRoute("OrderDetails", "orderdetails/{orderId:min(0)}", new { controller = "Order", action = "Details" }); routeBuilder.MapLocalizedRoute("ShipmentDetails", "orderdetails/shipment/{shipmentId}", new { controller = "Order", action = "ShipmentDetails" }); routeBuilder.MapLocalizedRoute("ReturnRequest", "returnrequest/{orderId:min(0)}", new { controller = "ReturnRequest", action = "ReturnRequest" }); routeBuilder.MapLocalizedRoute("ReOrder", "reorder/{orderId:min(0)}", new { controller = "Order", action = "ReOrder" }); routeBuilder.MapLocalizedRoute("GetOrderPdfInvoice", "orderdetails/pdf/{orderId}", new { controller = "Order", action = "GetPdfInvoice" }); routeBuilder.MapLocalizedRoute("PrintOrderDetails", "orderdetails/print/{orderId}", new { controller = "Order", action = "PrintOrderDetails" }); //order downloads routeBuilder.MapRoute("GetDownload", "download/getdownload/{orderItemId:guid}/{agree?}", new { controller = "Download", action = "GetDownload" }); routeBuilder.MapRoute("GetLicense", "download/getlicense/{orderItemId:guid}/", new { controller = "Download", action = "GetLicense" }); routeBuilder.MapLocalizedRoute("DownloadUserAgreement", "customer/useragreement/{orderItemId:guid}", new { controller = "Customer", action = "UserAgreement" }); routeBuilder.MapRoute("GetOrderNoteFile", "download/ordernotefile/{ordernoteid:min(0)}", new { controller = "Download", action = "GetOrderNoteFile" }); //contact vendor routeBuilder.MapLocalizedRoute("ContactVendor", "contactvendor/{vendorId}", new { controller = "Common", action = "ContactVendor" }); //apply for vendor account routeBuilder.MapLocalizedRoute("ApplyVendorAccount", "vendor/apply", new { controller = "Vendor", action = "ApplyVendor" }); //vendor info routeBuilder.MapLocalizedRoute("CustomerVendorInfo", "customer/vendorinfo", new { controller = "Vendor", action = "Info" }); //customer GDPR routeBuilder.MapLocalizedRoute("GdprTools", "customer/gdpr", new { controller = "Customer", action = "GdprTools" }); //customer check gift card balance routeBuilder.MapLocalizedRoute("CheckGiftCardBalance", "customer/CheckGiftCardBalance", new { controller = "Customer", action = "CheckGiftCardBalance" }); //poll vote AJAX link routeBuilder.MapLocalizedRoute("PollVote", "poll/vote", new { controller = "Poll", action = "Vote" }); //comparing products routeBuilder.MapLocalizedRoute("RemoveProductFromCompareList", "compareproducts/remove/{productId}", new { controller = "Product", action = "RemoveProductFromCompareList" }); routeBuilder.MapLocalizedRoute("ClearCompareList", "clearcomparelist/", new { controller = "Product", action = "ClearCompareList" }); //new RSS routeBuilder.MapLocalizedRoute("NewProductsRSS", "newproducts/rss", new { controller = "Product", action = "NewProductsRss" }); //get state list by country ID (AJAX link) routeBuilder.MapRoute("GetStatesByCountryId", "country/getstatesbycountryid/", new { controller = "Country", action = "GetStatesByCountryId" }); //EU Cookie law accept button handler (AJAX link) routeBuilder.MapRoute("EuCookieLawAccept", "eucookielawaccept", new { controller = "Common", action = "EuCookieLawAccept" }); //authenticate topic AJAX link routeBuilder.MapLocalizedRoute("TopicAuthenticate", "topic/authenticate", new { controller = "Topic", action = "Authenticate" }); //product attributes with "upload file" type routeBuilder.MapLocalizedRoute("UploadFileProductAttribute", "uploadfileproductattribute/{attributeId:min(0)}", new { controller = "ShoppingCart", action = "UploadFileProductAttribute" }); //checkout attributes with "upload file" type routeBuilder.MapLocalizedRoute("UploadFileCheckoutAttribute", "uploadfilecheckoutattribute/{attributeId:min(0)}", new { controller = "ShoppingCart", action = "UploadFileCheckoutAttribute" }); //return request with "upload file" support routeBuilder.MapLocalizedRoute("UploadFileReturnRequest", "uploadfilereturnrequest", new { controller = "ReturnRequest", action = "UploadFileReturnRequest" }); //forums routeBuilder.MapLocalizedRoute("ActiveDiscussions", "boards/activediscussions", new { controller = "Boards", action = "ActiveDiscussions" }); routeBuilder.MapLocalizedRoute("ActiveDiscussionsPaged", "boards/activediscussions/page/{pageNumber:regex(\\d*)}", new { controller = "Boards", action = "ActiveDiscussions" }); routeBuilder.MapLocalizedRoute("ActiveDiscussionsRSS", "boards/activediscussionsrss", new { controller = "Boards", action = "ActiveDiscussionsRSS" }); routeBuilder.MapLocalizedRoute("PostEdit", "boards/postedit/{id:min(0)}", new { controller = "Boards", action = "PostEdit" }); routeBuilder.MapLocalizedRoute("PostDelete", "boards/postdelete/{id:min(0)}", new { controller = "Boards", action = "PostDelete" }); routeBuilder.MapLocalizedRoute("PostCreate", "boards/postcreate/{id:min(0)}", new { controller = "Boards", action = "PostCreate" }); routeBuilder.MapLocalizedRoute("PostCreateQuote", "boards/postcreate/{id:min(0)}/{quote:min(0)}", new { controller = "Boards", action = "PostCreate" }); routeBuilder.MapLocalizedRoute("TopicEdit", "boards/topicedit/{id:min(0)}", new { controller = "Boards", action = "TopicEdit" }); routeBuilder.MapLocalizedRoute("TopicDelete", "boards/topicdelete/{id:min(0)}", new { controller = "Boards", action = "TopicDelete" }); routeBuilder.MapLocalizedRoute("TopicCreate", "boards/topiccreate/{id:min(0)}", new { controller = "Boards", action = "TopicCreate" }); routeBuilder.MapLocalizedRoute("TopicMove", "boards/topicmove/{id:min(0)}", new { controller = "Boards", action = "TopicMove" }); routeBuilder.MapLocalizedRoute("TopicWatch", "boards/topicwatch/{id:min(0)}", new { controller = "Boards", action = "TopicWatch" }); routeBuilder.MapLocalizedRoute("TopicSlug", "boards/topic/{id:min(0)}/{slug?}", new { controller = "Boards", action = "Topic" }); routeBuilder.MapLocalizedRoute("TopicSlugPaged", "boards/topic/{id:min(0)}/{slug?}/page/{pageNumber:regex(\\d*)}", new { controller = "Boards", action = "Topic" }); routeBuilder.MapLocalizedRoute("ForumWatch", "boards/forumwatch/{id:min(0)}", new { controller = "Boards", action = "ForumWatch" }); routeBuilder.MapLocalizedRoute("ForumRSS", "boards/forumrss/{id:min(0)}", new { controller = "Boards", action = "ForumRSS" }); routeBuilder.MapLocalizedRoute("ForumSlug", "boards/forum/{id:min(0)}/{slug?}", new { controller = "Boards", action = "Forum" }); routeBuilder.MapLocalizedRoute("ForumSlugPaged", "boards/forum/{id:min(0)}/{slug?}/page/{pageNumber:regex(\\d*)}", new { controller = "Boards", action = "Forum" }); routeBuilder.MapLocalizedRoute("ForumGroupSlug", "boards/forumgroup/{id:min(0)}/{slug?}", new { controller = "Boards", action = "ForumGroup" }); routeBuilder.MapLocalizedRoute("Search", "boards/search", new { controller = "Boards", action = "Search" }); //private messages routeBuilder.MapLocalizedRoute("PrivateMessages", "privatemessages/{tab?}", new { controller = "PrivateMessages", action = "Index" }); routeBuilder.MapLocalizedRoute("PrivateMessagesPaged", "privatemessages/{tab?}/page/{pageNumber:min(0)}", new { controller = "PrivateMessages", action = "Index" }); routeBuilder.MapLocalizedRoute("PrivateMessagesInbox", "inboxupdate", new { controller = "PrivateMessages", action = "InboxUpdate" }); routeBuilder.MapLocalizedRoute("PrivateMessagesSent", "sentupdate", new { controller = "PrivateMessages", action = "SentUpdate" }); routeBuilder.MapLocalizedRoute("SendPM", "sendpm/{toCustomerId:min(0)}", new { controller = "PrivateMessages", action = "SendPM" }); routeBuilder.MapLocalizedRoute("SendPMReply", "sendpm/{toCustomerId:min(0)}/{replyToMessageId:min(0)}", new { controller = "PrivateMessages", action = "SendPM" }); routeBuilder.MapLocalizedRoute("ViewPM", "viewpm/{privateMessageId:min(0)}", new { controller = "PrivateMessages", action = "ViewPM" }); routeBuilder.MapLocalizedRoute("DeletePM", "deletepm/{privateMessageId:min(0)}", new { controller = "PrivateMessages", action = "DeletePM" }); //activate newsletters routeBuilder.MapLocalizedRoute("NewsletterActivation", "newsletter/subscriptionactivation/{token:guid}/{active}", new { controller = "Newsletter", action = "SubscriptionActivation" }); //robots.txt routeBuilder.MapRoute("robots.txt", "robots.txt", new { controller = "Common", action = "RobotsTextFile" }); //sitemap (XML) routeBuilder.MapLocalizedRoute("sitemap.xml", "sitemap.xml", new { controller = "Common", action = "SitemapXml" }); routeBuilder.MapLocalizedRoute("sitemap-indexed.xml", "sitemap-{Id:min(0)}.xml", new { controller = "Common", action = "SitemapXml" }); //store closed routeBuilder.MapLocalizedRoute("StoreClosed", "storeclosed", new { controller = "Common", action = "StoreClosed" }); //install routeBuilder.MapRoute("Installation", "install", new { controller = "Install", action = "Index" }); //error page routeBuilder.MapLocalizedRoute("Error", "error", new { controller = "Common", action = "Error" }); //page not found routeBuilder.MapLocalizedRoute("PageNotFound", "page-not-found", new { controller = "Common", action = "PageNotFound" }); }
public static IRouteBuilder RegisterDefaultRoutes(this IRouteBuilder route) => route.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}");
public PluginRoutes(IRouteBuilder routeBuilder) { _routeBuilder = routeBuilder; }
private IServiceProvider GetServiceProvider(IRouteBuilder routeBuilder, string routeName) { IPerRouteContainer perRouteContainer = routeBuilder.ServiceProvider.GetRequiredService <IPerRouteContainer>(); return(perRouteContainer.GetODataRootContainer(routeName)); }
public override void Configure(IApplicationBuilder app, IRouteBuilder routes, IServiceProvider serviceProvider) { app.UseAuthentication(); }
private void ConfigureRoutes(IRouteBuilder routebuilder) //route tanımlamanın farklı yöntemi { //route ı elle tanımlayalım routebuilder.MapRoute("Default", "{controller=Product}/{action=index}/{id?}"); }
private void EnsureAttributeMapping(AttributeRoutingConvention convention, IRouteBuilder routeBuilder) { var mappings = convention.AttributeMappings; }
private void ConfigureRoutes(IRouteBuilder routeBuilder) { routeBuilder.MapRoute("Default", "{controller}/{action}/{id?}"); }
public void RegisterRoutes(IRouteBuilder routeBuilder) { routeBuilder.MapRoute(name: "Extension A", template: "", defaults: new { controller = "ExtensionA", action = "Index" }); }
private void ConfigRoutes(IRouteBuilder route) { route.MapRoute("Default", "{controller=Books}/{action=Index}/{id?}"); }
private IRouteBuilder ConfigureRoutes(IRouteBuilder routes) { routes.MapRoute(name: "default", template: "{controller=Home}/{action=Index}/{id?}"); return routes; }
public override void Configure( IApplicationBuilder app, IRouteBuilder routes, IServiceProvider serviceProvider) { }
private void Configurationroute(IRouteBuilder obj) { obj.MapRoute("Default", "{controller=Main}/{action=Index}/{id?}"); }
public void LoadRuntime(string path) { IRouteBuilder routeBuilder = RouteBuilder.Builder; ApplicationAssemblyLoader.GetControllerNames(); }
private void ConfigureRoutes(IRouteBuilder routeBuilder)//routeda configureda yapılabilir. { //Home/Index routeBuilder.MapRoute("Default", "{controller=Product}/{action=Index}/{id?}"); }
public void BuildRoutes(IRouteBuilder routeBuilder) { this.routeBuilder = routeBuilder; //TODO: this needs more thought //var applicationModel = BuildModel(); //ApplicationModelConventions.ApplyConventions(applicationModel, conventions); //foreach(var controllerModel in applicationModel.Controllers.Where(x => x.ControllerType.Namespace.StartsWith(options.Namespace))) { // if(controllerModel.ControllerType.Namespace.Equals(options.Namespace)) { // var action = controllerModel.Actions.Where(x => x.ActionMethod.Name == options.ActionMethodName).FirstOrDefault(); // var routeParameters = action.Parameters.Where(x => x.ParameterInfo.ParameterType.GetProperties().Where(y => y.IsDefined(typeof(FromRouteAttribute))).Any()); // routeBuilder.AddGetRoute("/", c => c.Action(controllerModel.Actions.Where(x=> x.ActionMethod.Name == options.ActionMethodName).FirstOrDefault().ActionMethod)); // } //} }
private void ConfigureRoute(IRouteBuilder routeBuilder) { // Home/Index routeBuilder.MapRoute("Default", "{controller=Home}/{action=Index}/{id?}"); }
private void ConfigureRoutes(IRouteBuilder routes) { routes.MapRoute("Default", "{controller}/{action}", new { controller = "Layout", action = "Index" }); }
private static void configureRoutes(IRouteBuilder routes) { routes.MapRoute("default", "{controller=Home}/{action=Index}/{id?}"); routes.MapRoute("admin", "admin/{controller=User}/{action=Index}/{id?}"); routes.MapRoute("shop", "{controller=Product}/{action=Index}/{id?}"); }
public void RegisterRoutes(IRouteBuilder routeBuilder) { }
private static IInlineConstraintResolver GetConstraintResolver(IRouteBuilder builder) { return builder.ServiceProvider.GetRequiredService<IInlineConstraintResolver>(); }
public void RegisterRoutes(IRouteBuilder routeBuilder) { routeBuilder.MapCmsRoutes(); }
/// <summary> /// Maps the specified route template and sets default route values. /// </summary> /// <param name="builder">The IRouteBuilder.</param> /// <param name="name">The name of the route to map.</param> /// <param name="routeTemplate">The route template for the route.</param> /// <param name="defaults">An object that contains default route values.</param> /// <returns> A reference to the IRouteBuilder.</returns> public static IRouteBuilder MapNonODataRoute(this IRouteBuilder builder, string name, string routeTemplate, object defaults) { return(builder.MapRoute(name, routeTemplate, defaults)); }
static public IRouteBuilder MapLyniconRoutes(this IRouteBuilder builder) { LyniconModuleManager.Instance.MapRoutes(builder); return(builder); }
public void RegisterRoutes(IRouteBuilder routeBuilder) { //override some of default routes in Admin area //routeBuilder.MapRoute("Plugin.Widgets.HomePageNewProductsPlugin.TestRouting", "Plugins/WidgetsHomePageNewProducts/TestRouting", // new { controller = "WidgetsHomePageNewProducts", action = "TestRouting" }); }
public override void Configure( IApplicationBuilder app, IRouteBuilder routes, IServiceProvider serviceProvider) { // Register client options middleware app.UseMiddleware <WebApiClientOptionsMiddleware>(); // Generate CSRF token for client api requests var keyGenerator = app.ApplicationServices.GetService <IKeyGenerator>(); var csrfToken = keyGenerator.GenerateKey(o => { o.MaxLength = 75; }); // Add client accessible CSRF token for web api requests app.Use(next => ctx => { // ensure the cookie does not already exist var cookie = ctx.Request.Cookies[PlatoAntiForgeryOptions.AjaxCsrfTokenCookieName]; if (cookie == null) { ctx.Response.Cookies.Append(PlatoAntiForgeryOptions.AjaxCsrfTokenCookieName, csrfToken, new CookieOptions() { HttpOnly = false }); } else { // Delete any existing cookie ctx.Response.Cookies.Delete(cookie); // Create new cookie ctx.Response.Cookies.Append(PlatoAntiForgeryOptions.AjaxCsrfTokenCookieName, csrfToken, new CookieOptions() { HttpOnly = false }); } return(next(ctx)); }); // WebApi Settings routes.MapAreaRoute( name: "WebApiAdmin", areaName: "Plato.WebApi", template: "admin/settings/api", defaults: new { controller = "Admin", action = "Index" } ); // Reset API Key routes.MapAreaRoute( name: "ResetApiKey", areaName: "Plato.WebApi", template: "admin/settings/api/reset", defaults: new { controller = "Admin", action = "ResetApiKey" } ); // Reset user API Key routes.MapAreaRoute( name: "ResetUserApiKey", areaName: "Plato.WebApi", template: "admin/users/{id}/api/reset", defaults: new { controller = "Admin", action = "ResetUserApiKey" } ); // Api routes routes.MapAreaRoute( name: "PlatoWebApi", areaName: "Plato.WebApi", template: "api/{controller}/{action}/{id?}", defaults: new { controller = "Users", action = "Get" } ); }
public static IRouteBuilder MapMvcSchema(this IRouteBuilder routes, string routeAnalyzerUrlPath) { MvcSchemaUrlPath = routeAnalyzerUrlPath; routes.Routes.Add(new Router(routes.DefaultHandler, routeAnalyzerUrlPath)); return(routes); }