Class HubMethod<TResult>
Defines a hub method with no arguments that returns a result. Methods can be invoked in either direction: by a client on the server (handled by a hub method with the same name) or by the server on a specific client (handled by a client handler that returns the result).
Namespace: Singulink.Net.Http.Api
Assembly: Singulink.Net.Http.Api.dll
Syntax
public sealed class HubMethod<TResult>
Type Parameters
| Name | Description |
|---|---|
| TResult | The type of the result. |
Remarks
The method name defaults to the name of the member that the definition is assigned to (via CallerMemberNameAttribute), so definitions are
typically declared as static properties in a shared contract class, e.g. public static HubMethod<int, int> Double { get; } = new();.
Constructors
| Name | Description |
|---|---|
| HubMethod(string) | Initializes a new instance of the HubMethod<TResult> class. |
Properties
| Name | Description |
|---|---|
| Name | Gets the method name. |
Methods
| Name | Description |
|---|---|
| ToString() | Returns a string that represents the current object. |