Passa al contenuto principale

Class WebRouteAttribute

Namespace: TecnoPack.WebServer
Assembly: CO0002_Templ_FlowpackHMI_V00_26_M.dll

Marks a method as a web route handler.

[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public class WebRouteAttribute : Attribute

Inheritance

object ← Attribute ← WebRouteAttribute

Remarks

Allows specifying the HTTP method and the path that this method handles. Can be applied multiple times to the same method to handle different HTTP methods or paths.

Constructors

WebRouteAttribute(HttpMethod, string)

Initializes a new instance of .

public WebRouteAttribute(HttpMethod method, string path)

Parameters

method HttpMethod

The HTTP method this route responds to.

path string

The relative path for the route.

Properties

Method

The HTTP method (GET, POST, etc.) that this route responds to.

public HttpMethod Method { get; }

Property Value

HttpMethod

Path

The relative path for the route, e.g., "/dashboard/data".

public string Path { get; }

Property Value

string