Beispiel #1
0
    public static string CreateActionKey(string url)
    {
        var absolutePath = PathAndQuery.CreateUri(url)?.AbsolutePath;

        absolutePath = absolutePath?.Trim().TrimStart('/');
        var routeKey = $"routepath_{absolutePath}".Replace("/", "_").Replace("\\", "_");

        return(CreateMD5Hash(routeKey));
    }
Beispiel #2
0
    public static string CreateActionKey(string?controllerPath, string?actionUrl)
    {
        var absolutePath = PathAndQuery.CreateUri(actionUrl)?.AbsolutePath;

        controllerPath = controllerPath?.Trim().TrimStart('/');
        absolutePath   = absolutePath?.Trim().TrimStart('/');
        string?routeKey;

        if (string.IsNullOrWhiteSpace(controllerPath))
        {
            routeKey = $"routepath_{absolutePath}".Replace("/", "_").Replace("\\", "_");
        }
        else
        {
            routeKey = $"routepath_{controllerPath}_{absolutePath}".Replace("/", "_").Replace("\\", "_");
        }

        return(CreateMD5Hash(routeKey));
    }