Created
June 7, 2023 08:31
-
-
Save skttl/c77cbc26828493f6a6b56b4ef6d8c578 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Umbraco.Cms.Web.Website.Controllers; | |
namespace Ecreo.Essentials.Helpers; | |
public static class UrlHelperExtensions | |
{ | |
public static string? Action<T>(this IUrlHelper Url, string name) where T : SurfaceController | |
{ | |
return Url.Action<T>(name, null, null, null, null); | |
} | |
public static string? Action<T>(this IUrlHelper Url, string name, object? values) where T : SurfaceController | |
{ | |
return Url.Action<T>(name, values, null, null, null); | |
} | |
public static string? Action<T>(this IUrlHelper Url, string name, object? values, string? protocol) where T : SurfaceController | |
{ | |
return Url.Action<T>(name, values, protocol, null, null); | |
} | |
public static string? Action<T>(this IUrlHelper Url, string name, object? values, string? protocol, string? host) where T : SurfaceController | |
{ | |
return Url.Action<T>(name, values, protocol, host, null); | |
} | |
public static string? Action<T>(this IUrlHelper Url, string name, object? values, string? protocol, string? host, string? fragment) where T : SurfaceController | |
{ | |
return Url.Action(name, ControllerExtensions.GetControllerName(typeof(T)), values, protocol, host, fragment); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment