Friday, 10 September 2021

Asp.net Mvc Url extentisons

  public static class UrlHelperExtensions

    {

        //

        // Summary:

        //     Generates a URL with an absolute path for an action method.

        //

        // Parameters:

        //   helper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        // Returns:

        //     The generated URL.

        public static string Action(this IUrlHelper helper);

       

//

        // Summary:

        //     Generates a URL with an absolute path for an action method, which contains the

        //     specified action name.

        //

        // Parameters:

        //   helper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   action:

        //     The name of the action method.

        //

        // Returns:

        //     The generated URL.

        public static string Action(this IUrlHelper helper, string action);

        //

        // Summary:

        //     Generates a URL with an absolute path for an action method, which contains the

        //     specified action name and route values.

        //

        // Parameters:

        //   helper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   action:

        //     The name of the action method.

        //

        //   values:

        //     An object that contains route values.

        //

        // Returns:

        //     The generated URL.

        public static string Action(this IUrlHelper helper, string action, object values);

        //

        // Summary:

        //     Generates a URL with an absolute path for an action method, which contains the

        //     specified action and controller names.

        //

        // Parameters:

        //   helper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   action:

        //     The name of the action method.

        //

        //   controller:

        //     The name of the controller.

        //

        // Returns:

        //     The generated URL.

        public static string Action(this IUrlHelper helper, string action, string controller);

        //

        // Summary:

        //     Generates a URL with an absolute path for an action method, which contains the

        //     specified action name, controller name, and route values.

        //

        // Parameters:

        //   helper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   action:

        //     The name of the action method.

        //

        //   controller:

        //     The name of the controller.

        //

        //   values:

        //     An object that contains route values.

        //

        // Returns:

        //     The generated URL.

        public static string Action(this IUrlHelper helper, string action, string controller, object values);

        //

        // Summary:

        //     Generates a URL with an absolute path for an action method, which contains the

        //     specified action name, controller name, route values, and protocol to use. See

        //     the remarks section for important security information.

        //

        // Parameters:

        //   helper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   action:

        //     The name of the action method.

        //

        //   controller:

        //     The name of the controller.

        //

        //   values:

        //     An object that contains route values.

        //

        //   protocol:

        //     The protocol for the URL, such as "http" or "https".

        //

        // Returns:

        //     The generated URL.

        //

        // Remarks:

        //     This method uses the value of Microsoft.AspNetCore.Http.HttpRequest.Host to populate

        //     the host section of the generated URI. Relying on the value of the current request

        //     can allow untrusted input to influence the resulting URI unless the Host header

        //     has been validated. See the deployment documentation for instructions on how

        //     to properly validate the Host header in your deployment environment.

        public static string Action(this IUrlHelper helper, string action, string controller, object values, string protocol);

        //

        // Summary:

        //     Generates a URL with an absolute path for an action method, which contains the

        //     specified action name, controller name, route values, protocol to use, and host

        //     name. Generates an absolute URL if the protocol and host are non-null. See the

        //     remarks section for important security information.

        //

        // Parameters:

        //   helper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   action:

        //     The name of the action method.

        //

        //   controller:

        //     The name of the controller.

        //

        //   values:

        //     An object that contains route values.

        //

        //   protocol:

        //     The protocol for the URL, such as "http" or "https".

        //

        //   host:

        //     The host name for the URL.

        //

        // Returns:

        //     The generated URL.

        //

        // Remarks:

        //     The value of host should be a trusted value. Relying on the value of the current

        //     request can allow untrusted input to influence the resulting URI unless the Host

        //     header has been validated. See the deployment documentation for instructions

        //     on how to properly validate the Host header in your deployment environment.

        public static string Action(this IUrlHelper helper, string action, string controller, object values, string protocol, string host);

        //

        // Summary:

        //     Generates a URL with an absolute path for an action method, which contains the

        //     specified action name, controller name, route values, protocol to use, host name,

        //     and fragment. Generates an absolute URL if the protocol and host are non-null.

        //     See the remarks section for important security information.

        //

        // Parameters:

        //   helper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   action:

        //     The name of the action method.

        //

        //   controller:

        //     The name of the controller.

        //

        //   values:

        //     An object that contains route values.

        //

        //   protocol:

        //     The protocol for the URL, such as "http" or "https".

        //

        //   host:

        //     The host name for the URL.

        //

        //   fragment:

        //     The fragment for the URL.

        //

        // Returns:

        //     The generated URL.

        //

        // Remarks:

        //     The value of host should be a trusted value. Relying on the value of the current

        //     request can allow untrusted input to influence the resulting URI unless the Host

        //     header has been validated. See the deployment documentation for instructions

        //     on how to properly validate the Host header in your deployment environment.

        public static string Action(this IUrlHelper helper, string action, string controller, object values, string protocol, string host, string fragment);

        //

        // Summary:

        //     Generates an absolute URL for an action method, which contains the specified

        //     action name, controller name, route values, protocol to use, host name, and fragment.

        //     Generates an absolute URL if the protocol and host are non-null. See the remarks

        //     section for important security information.

        //

        // Parameters:

        //   helper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   action:

        //     The name of the action method. When null, defaults to the current executing action.

        //

        //   controller:

        //     The name of the controller. When null, defaults to the current executing controller.

        //

        //   values:

        //     An object that contains route values.

        //

        //   protocol:

        //     The protocol for the URL, such as "http" or "https".

        //

        //   host:

        //     The host name for the URL.

        //

        //   fragment:

        //     The fragment for the URL.

        //

        // Returns:

        //     The generated URL.

        //

        // Remarks:

        //     The value of host should be a trusted value. Relying on the value of the current

        //     request can allow untrusted input to influence the resulting URI unless the Host

        //     header has been validated. See the deployment documentation for instructions

        //     on how to properly validate the Host header in your deployment environment.

        public static string ActionLink(this IUrlHelper helper, string action = null, string controller = null, object values = null, string protocol = null, string host = null, string fragment = null);

        //

        // Summary:

        //     Generates a URL with an absolute path for the specified pageName. See the remarks

        //     section for important security information.

        //

        // Parameters:

        //   urlHelper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   pageName:

        //     The page name to generate the url for.

        //

        //   pageHandler:

        //     The handler to generate the url for.

        //

        //   values:

        //     An object that contains route values.

        //

        //   protocol:

        //     The protocol for the URL, such as "http" or "https".

        //

        //   host:

        //     The host name for the URL.

        //

        //   fragment:

        //     The fragment for the URL.

        //

        // Returns:

        //     The generated URL.

        //

        // Remarks:

        //     The value of host should be a trusted value. Relying on the value of the current

        //     request can allow untrusted input to influence the resulting URI unless the Host

        //     header has been validated. See the deployment documentation for instructions

        //     on how to properly validate the Host header in your deployment environment.

        public static string Page(this IUrlHelper urlHelper, string pageName, string pageHandler, object values, string protocol, string host, string fragment);

        //

        // Summary:

        //     Generates a URL with an absolute path for the specified pageName. See the remarks

        //     section for important security information.

        //

        // Parameters:

        //   urlHelper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   pageName:

        //     The page name to generate the url for.

        //

        //   pageHandler:

        //     The handler to generate the url for.

        //

        //   values:

        //     An object that contains route values.

        //

        //   protocol:

        //     The protocol for the URL, such as "http" or "https".

        //

        //   host:

        //     The host name for the URL.

        //

        // Returns:

        //     The generated URL.

        //

        // Remarks:

        //     The value of host should be a trusted value. Relying on the value of the current

        //     request can allow untrusted input to influence the resulting URI unless the Host

        //     header has been validated. See the deployment documentation for instructions

        //     on how to properly validate the Host header in your deployment environment.

        public static string Page(this IUrlHelper urlHelper, string pageName, string pageHandler, object values, string protocol, string host);

        //

        // Summary:

        //     Generates a URL with an absolute path for the specified pageName. See the remarks

        //     section for important security information.

        //

        // Parameters:

        //   urlHelper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   pageName:

        //     The page name to generate the url for.

        //

        //   pageHandler:

        //     The handler to generate the url for.

        //

        //   values:

        //     An object that contains route values.

        //

        //   protocol:

        //     The protocol for the URL, such as "http" or "https".

        //

        // Returns:

        //     The generated URL.

        //

        // Remarks:

        //     This method uses the value of Microsoft.AspNetCore.Http.HttpRequest.Host to populate

        //     the host section of the generated URI. Relying on the value of the current request

        //     can allow untrusted input to influence the resulting URI unless the Host header

        //     has been validated. See the deployment documentation for instructions on how

        //     to properly validate the Host header in your deployment environment.

        public static string Page(this IUrlHelper urlHelper, string pageName, string pageHandler, object values, string protocol);

        //

        // Summary:

        //     Generates a URL with a relative path for the specified pageName.

        //

        // Parameters:

        //   urlHelper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   pageName:

        //     The page name to generate the url for.

        //

        //   pageHandler:

        //     The handler to generate the url for.

        //

        // Returns:

        //     The generated URL.

        public static string Page(this IUrlHelper urlHelper, string pageName, string pageHandler);

        //

        // Summary:

        //     Generates a URL with a relative path for the specified pageName.

        //

        // Parameters:

        //   urlHelper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   pageName:

        //     The page name to generate the url for.

        //

        //   values:

        //     An object that contains route values.

        //

        // Returns:

        //     The generated URL.

        public static string Page(this IUrlHelper urlHelper, string pageName, object values);

        //

        // Summary:

        //     Generates a URL with a relative path for the specified pageName.

        //

        // Parameters:

        //   urlHelper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   pageName:

        //     The page name to generate the url for.

        //

        // Returns:

        //     The generated URL.

        public static string Page(this IUrlHelper urlHelper, string pageName);

        //

        // Summary:

        //     Generates a URL with a relative path for the specified pageName.

        //

        // Parameters:

        //   urlHelper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   pageName:

        //     The page name to generate the url for.

        //

        //   pageHandler:

        //     The handler to generate the url for.

        //

        //   values:

        //     An object that contains route values.

        //

        // Returns:

        //     The generated URL.

        public static string Page(this IUrlHelper urlHelper, string pageName, string pageHandler, object values);

        //

        // Summary:

        //     Generates an absolute URL for a page, which contains the specified pageName,

        //     pageHandler, route values, protocol to use, host name, and fragment. Generates

        //     an absolute URL if the protocol and host are non-null. See the remarks section

        //     for important security information.

        //

        // Parameters:

        //   urlHelper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   pageName:

        //     The page name to generate the url for. When null, defaults to the current executing

        //     page.

        //

        //   pageHandler:

        //     The handler to generate the url for. When null, defaults to the current executing

        //     handler.

        //

        //   values:

        //     An object that contains route values.

        //

        //   protocol:

        //     The protocol for the URL, such as "http" or "https".

        //

        //   host:

        //     The host name for the URL.

        //

        //   fragment:

        //     The fragment for the URL.

        //

        // Returns:

        //     The generated URL.

        //

        // Remarks:

        //     The value of host should be a trusted value. Relying on the value of the current

        //     request can allow untrusted input to influence the resulting URI unless the Host

        //     header has been validated. See the deployment documentation for instructions

        //     on how to properly validate the Host header in your deployment environment.

        public static string PageLink(this IUrlHelper urlHelper, string pageName = null, string pageHandler = null, object values = null, string protocol = null, string host = null, string fragment = null);

        //

        // Summary:

        //     Generates a URL with an absolute path for the specified route routeName and route

        //     values, which contains the specified protocol to use and host name. Generates

        //     an absolute URL if Microsoft.AspNetCore.Mvc.Routing.UrlActionContext.Protocol

        //     and Microsoft.AspNetCore.Mvc.Routing.UrlActionContext.Host are non-null. See

        //     the remarks section for important security information.

        //

        // Parameters:

        //   helper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   routeName:

        //     The name of the route that is used to generate URL.

        //

        //   values:

        //     An object that contains route values.

        //

        //   protocol:

        //     The protocol for the URL, such as "http" or "https".

        //

        //   host:

        //     The host name for the URL.

        //

        // Returns:

        //     The generated URL.

        //

        // Remarks:

        //     The value of host should be a trusted value. Relying on the value of the current

        //     request can allow untrusted input to influence the resulting URI unless the Host

        //     header has been validated. See the deployment documentation for instructions

        //     on how to properly validate the Host header in your deployment environment.

        public static string RouteUrl(this IUrlHelper helper, string routeName, object values, string protocol, string host);

        //

        // Summary:

        //     Generates a URL with an absolute path for the specified route values.

        //

        // Parameters:

        //   helper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   values:

        //     An object that contains route values.

        //

        // Returns:

        //     The generated URL.

        public static string RouteUrl(this IUrlHelper helper, object values);

        //

        // Summary:

        //     Generates a URL with an absolute path for the specified routeName.

        //

        // Parameters:

        //   helper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   routeName:

        //     The name of the route that is used to generate URL.

        //

        // Returns:

        //     The generated URL.

        public static string RouteUrl(this IUrlHelper helper, string routeName);

        //

        // Summary:

        //     Generates a URL with an absolute path for the specified routeName and route values.

        //

        // Parameters:

        //   helper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   routeName:

        //     The name of the route that is used to generate URL.

        //

        //   values:

        //     An object that contains route values.

        //

        // Returns:

        //     The generated URL.

        public static string RouteUrl(this IUrlHelper helper, string routeName, object values);

        //

        // Summary:

        //     Generates a URL with an absolute path for the specified route routeName and route

        //     values, which contains the specified protocol to use. See the remarks section

        //     for important security information.

        //

        // Parameters:

        //   helper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   routeName:

        //     The name of the route that is used to generate URL.

        //

        //   values:

        //     An object that contains route values.

        //

        //   protocol:

        //     The protocol for the URL, such as "http" or "https".

        //

        // Returns:

        //     The generated URL.

        //

        // Remarks:

        //     This method uses the value of Microsoft.AspNetCore.Http.HttpRequest.Host to populate

        //     the host section of the generated URI. Relying on the value of the current request

        //     can allow untrusted input to influence the resulting URI unless the Host header

        //     has been validated. See the deployment documentation for instructions on how

        //     to properly validate the Host header in your deployment environment.

        public static string RouteUrl(this IUrlHelper helper, string routeName, object values, string protocol);

        //

        // Summary:

        //     Generates a URL with an absolute path for the specified route routeName and route

        //     values, which contains the specified protocol to use, host name and fragment.

        //     Generates an absolute URL if Microsoft.AspNetCore.Mvc.Routing.UrlActionContext.Protocol

        //     and Microsoft.AspNetCore.Mvc.Routing.UrlActionContext.Host are non-null. See

        //     the remarks section for important security information.

        //

        // Parameters:

        //   helper:

        //     The Microsoft.AspNetCore.Mvc.IUrlHelper.

        //

        //   routeName:

        //     The name of the route that is used to generate URL.

        //

        //   values:

        //     An object that contains route values.

        //

        //   protocol:

        //     The protocol for the URL, such as "http" or "https".

        //

        //   host:

        //     The host name for the URL.

        //

        //   fragment:

        //     The fragment for the URL.

        //

        // Returns:

        //     The generated URL.

        //

        // Remarks:

        //     The value of host should be a trusted value. Relying on the value of the current

        //     request can allow untrusted input to influence the resulting URI unless the Host

        //     header has been validated. See the deployment documentation for instructions

        //     on how to properly validate the Host header in your deployment environment.

        public static string RouteUrl(this IUrlHelper helper, string routeName, object values, string protocol, string host, string fragment);

    }

}

No comments:

Post a Comment

7 Common mistakes in Dot Net — You can avoid

  There are many common mistakes made during .NET (ASP.NET, .NET Core) development, which affect performance, security, and code… Code Crack...