Пример #1
0
        protected override string GetRouteUrl(RouteStrategyMarkupFileInfo file)
        {
            var fileRelativePathWithoutFileName = GetFileRelativePathWithoutFileName(file);

            return(SplitWordsByCamelCaseNotation(fileRelativePathWithoutFileName)
                   .ToLowerInvariant());
        }
Пример #2
0
        private static string GetFileRelativePathWithoutFileName(RouteStrategyMarkupFileInfo file)
        {
            var lastSlashIndex = file.ViewsFolderRelativePath.LastIndexOf('/');
            var fileRelativePathWithoutFileName = file.ViewsFolderRelativePath
                                                  .Substring(0, lastSlashIndex);

            return(fileRelativePathWithoutFileName);
        }
 protected override object GetRouteDefaultParameters(RouteStrategyMarkupFileInfo file)
 {
     if (IsDetailPage(file))
     {
         return(new { Id = 0 });
     }
     return(base.GetRouteDefaultParameters(file));
 }
 protected override string GetRouteUrl(RouteStrategyMarkupFileInfo file)
 {
     if (IsDetailPage(file))
     {
         return("Admin/" + base.GetRouteUrl(file) + "/{Id?}");
     }
     return("Admin/" + base.GetRouteUrl(file));
 }
        protected override string GetRouteUrl(RouteStrategyMarkupFileInfo file)
        {
            var url = base.GetRouteUrl(file);

            if (url.StartsWith("Investigation/Export"))
            {
                url = url.Replace("Investigation/Export/", String.Empty);
                url = url.Replace("Framework/Snooper.", String.Empty);

                return("Investigation/{InvestigationId:guid}/Export/" + url);
            }
            return(base.GetRouteUrl(file));
        }
Пример #6
0
        protected override string GetRouteUrl(RouteStrategyMarkupFileInfo file)
        {
            var url = file.AppRelativePath;

            if (url.Contains("Books/"))
            {
                // instead of /home, we need the route to be directly in the website root /
                url = url.Replace("Books/", "");
            }

            if (url.Contains("Default.dothtml"))
            {
                url = url.Replace("Default.dothtml", "");
            }

            return(url);
        }
Пример #7
0
 private static bool IsDetailPage(RouteStrategyMarkupFileInfo file)
 {
     return(file.AppRelativePath.EndsWith("Detail.dothtml", StringComparison.CurrentCultureIgnoreCase));
 }
Пример #8
0
 protected override string GetRouteName(RouteStrategyMarkupFileInfo file)
 {
     return("Admin_" + file.ViewsFolderRelativePath.Replace("/", "_").Replace(".dothtml", ""));
 }
Пример #9
0
 protected override string GetRouteName(RouteStrategyMarkupFileInfo file)
 {
     return(GetFileRelativePathWithoutFileName(file)
            .Replace('/', '_'));
 }