Sisk

Method

Router.SetRoute

Namespace
Sisk.Core.Routing
Assembly
Sisk.Core.dll

SetRoute(RouteMethod, string, RouteAction) #

Defines an route with their method, path and action function.

C#
public void SetRoute(RouteMethod method, string path, RouteAction action)

Parameters #

method RouteMethod

The route method to be matched. “Any” means any method that matches their path.

path string

The route path.

action RouteAction

The route function to be called after matched.

SetRoute(RouteMethod, string, Delegate) #

Defines an route with their method, path and action function.

C#
public void SetRoute(RouteMethod method, string path, Delegate action)

Parameters #

method RouteMethod

The route method to be matched. “Any” means any method that matches their path.

path string

The route path.

action Delegate

The route function to be called after matched.

SetRoute(RouteMethod, string, Delegate, string?) #

Defines an route with their method, path, action function and name.

C#
public void SetRoute(RouteMethod method, string path, Delegate action, string? name)

Parameters #

method RouteMethod

The route method to be matched. “Any” means any method that matches their path.

path string

The route path.

action Delegate

The route function to be called after matched.

name string?

The route name.

SetRoute(RouteMethod, string, Delegate, string?, IRequestHandler[]) #

Defines an route with their method, path, action function, name and request handlers.

C#
public void SetRoute(RouteMethod method, string path, Delegate action, string? name, IRequestHandler[] middlewares)

Parameters #

method RouteMethod

The route method to be matched. “Any” means any method that matches their path.

path string

The route path.

action Delegate

The route function to be called after matched.

name string?

The route name.

middlewares IRequestHandler[]

Handlers that run before calling your route action.

SetRoute(Route) #

Defines an route in this Router instance.

C#
public void SetRoute(Route r)

Parameters #

r Route

The route to be defined in the Router.

Type to search the documentation and the API reference.