123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- using System.Web.Mvc;
- using System.Web.Routing;
-
- namespace Teknik
- {
- public static class SubdomainRouteExtension
- {
- public static SubdomainRoute MapSubdomainRoute(this RouteCollection routes, string name, string subDomain, string url, object defaults)
- {
-
- SubdomainRoute route = new SubdomainRoute(
- subDomain,
- url,
- new RouteValueDictionary(defaults),
- new MvcRouteHandler());
- routes.Add(name, route);
-
- return route;
- }
-
- public static SubdomainRoute MapSubdomainRoute(this RouteCollection routes, string name, string subDomain, string url, object defaults, object constraints)
- {
- SubdomainRoute route = new SubdomainRoute(
- subDomain,
- url,
- new RouteValueDictionary(defaults),
- new RouteValueDictionary(constraints),
- new MvcRouteHandler());
- routes.Add(name, route);
- return route;
- }
-
- public static SubdomainRoute MapSubdomainRoute(this RouteCollection routes, string name, string subDomain, string url, object defaults, string[] namespaces)
- {
- SubdomainRoute route = new SubdomainRoute(
- subDomain,
- url,
- new RouteValueDictionary(defaults),
- new RouteValueDictionary(namespaces),
- new MvcRouteHandler());
- routes.Add(name, route);
- return route;
- }
-
- public static SubdomainRoute MapSubdomainRoute(this AreaRegistrationContext context, string name, string subDomain, string url, object defaults)
- {
- SubdomainRoute route = new SubdomainRoute(
- subDomain,
- url,
- new RouteValueDictionary(defaults),
- new RouteValueDictionary(new {}),
- new RouteValueDictionary(new {Area = context.AreaName}),
- new MvcRouteHandler());
-
- context.Routes.Add(name, route);
- return route;
- }
-
- public static SubdomainRoute MapSubdomainRoute(this AreaRegistrationContext context, string name, string subDomain, string url, object defaults, object constraints)
- {
- SubdomainRoute route = new SubdomainRoute(
- subDomain,
- url,
- new RouteValueDictionary(defaults),
- new RouteValueDictionary(constraints),
- new RouteValueDictionary(new {Area = context.AreaName}),
- new MvcRouteHandler());
-
- context.Routes.Add(name, route);
- return route;
- }
-
- public static SubdomainRoute MapSubdomainRoute(this AreaRegistrationContext context, string name, string subDomain, string url, object defaults, string[] namespaces)
- {
- SubdomainRoute route = new SubdomainRoute(
- subDomain,
- url,
- new RouteValueDictionary(defaults),
- new RouteValueDictionary(new {}),
- new RouteValueDictionary(new { Area = context.AreaName, Namespaces = namespaces }),
- new MvcRouteHandler());
-
- context.Routes.Add(name, route);
- return route;
- }
-
- public static SubdomainRoute MapSubdomainRoute(this AreaRegistrationContext context, string name, string subDomain, string url, string area, object defaults)
- {
- SubdomainRoute route = new SubdomainRoute(
- subDomain,
- url,
- new RouteValueDictionary(defaults),
- new RouteValueDictionary(new { }),
- new RouteValueDictionary(new { Area = area }),
- new MvcRouteHandler());
-
- context.Routes.Add(name, route);
- return route;
- }
-
- public static SubdomainRoute MapSubdomainRoute(this AreaRegistrationContext context, string name, string subDomain, string url, string area, object defaults, object constraints)
- {
- SubdomainRoute route = new SubdomainRoute(
- subDomain,
- url,
- new RouteValueDictionary(defaults),
- new RouteValueDictionary(constraints),
- new RouteValueDictionary(new { Area = area }),
- new MvcRouteHandler());
-
- context.Routes.Add(name, route);
- return route;
- }
-
- public static SubdomainRoute MapSubdomainRoute(this AreaRegistrationContext context, string name, string subDomain, string url, string area, object defaults, string[] namespaces)
- {
- SubdomainRoute route = new SubdomainRoute(
- subDomain,
- url,
- new RouteValueDictionary(defaults),
- new RouteValueDictionary(new { }),
- new RouteValueDictionary(new { Area = area, Namespaces = namespaces }),
- new MvcRouteHandler());
-
- context.Routes.Add(name, route);
- return route;
- }
- }
- }
|