Table of Contents

Method SetRoute

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

SetRoute(RouteMethod, string, RouteAction)

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

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.

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.

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, RouteAction, string?, IRequestHandler[])

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

public void SetRoute(RouteMethod method, string path, RouteAction 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 RouteAction

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.

public void SetRoute(Route r)

Parameters

r Route

The route to be defined in the Router.