Blazor.Extensions.SignalR 0.4.0

SignalR Core support for ASP.NET Core Blazor.

This package is considered a SemVer 2.0.0 package as it has a package dependency on SemVer 2.0.0 package(s).
This package will only be available to download with SemVer 2.0.0 compatible NuGet clients, such as Visual Studio 2017 (version 15.3) and above or NuGet client 4.3.0 and above. Read more
Install-Package Blazor.Extensions.SignalR -Version 0.4.0
dotnet add package Blazor.Extensions.SignalR --version 0.4.0
<PackageReference Include="Blazor.Extensions.SignalR" Version="0.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Blazor.Extensions.SignalR --version 0.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Blazor Extensions SignalR

This package adds a Microsoft ASP.NET Core SignalR client library for Microsoft ASP.NET Blazor.

The package aims to mimic the C# APIs of SignalR Client as much as possible and it is developed by wrapping the TypeScript client by using Blazor's interop capabilities.

For more information about SignalR development, please check SignalR documentation.

Features

This package implements all public features of SignalR Typescript client.

Note: The Streaming APIs are not implemented yet. We will add it soon.

Sample usage

The following snippet shows how to setup the client to send and receive messages using SignalR.

var connection = new HubConnectionBuilder()
        .WithUrl("/myHub", // The hub URL. If the Hub is hosted on the server where the blazor is hosted, you can just use the relative path.
        opt =>
        {
            opt.LogLevel = SignalRLogLevel.Trace; // Client log level
            opt.Transport = HttpTransportType.WebSockets; // Which transport you want to use for this connection
        })
        .Build(); // Build the HubConnection

connection.On("Receive", this.Handle); // Subscribe to messages sent from the Hub to the "Receive" method by passing a handle (Func<object, Task>) to process messages.
await connection.StartAsync(); // Start the connection.

await connection.InvokeAsync("ServerMethod", param1, param2, paramX); // Invoke a method on the server called "ServerMethod" and pass parameters to it. 

var result = await connection.InvokeAsync<MyResult>("ServerMethod", param1, param2, paramX); // Invoke a method on the server called "ServerMethod", pass parameters to it and get the result back.

Contributions and feedback

Please feel free to use the component, open issues, fix bugs or provide feedback.

Contributors

The following people are the maintainers of the Blazor Extensions projects:

Blazor Extensions SignalR

This package adds a Microsoft ASP.NET Core SignalR client library for Microsoft ASP.NET Blazor.

The package aims to mimic the C# APIs of SignalR Client as much as possible and it is developed by wrapping the TypeScript client by using Blazor's interop capabilities.

For more information about SignalR development, please check SignalR documentation.

Features

This package implements all public features of SignalR Typescript client.

Note: The Streaming APIs are not implemented yet. We will add it soon.

Sample usage

The following snippet shows how to setup the client to send and receive messages using SignalR.

var connection = new HubConnectionBuilder()
        .WithUrl("/myHub", // The hub URL. If the Hub is hosted on the server where the blazor is hosted, you can just use the relative path.
        opt =>
        {
            opt.LogLevel = SignalRLogLevel.Trace; // Client log level
            opt.Transport = HttpTransportType.WebSockets; // Which transport you want to use for this connection
        })
        .Build(); // Build the HubConnection

connection.On("Receive", this.Handle); // Subscribe to messages sent from the Hub to the "Receive" method by passing a handle (Func<object, Task>) to process messages.
await connection.StartAsync(); // Start the connection.

await connection.InvokeAsync("ServerMethod", param1, param2, paramX); // Invoke a method on the server called "ServerMethod" and pass parameters to it. 

var result = await connection.InvokeAsync<MyResult>("ServerMethod", param1, param2, paramX); // Invoke a method on the server called "ServerMethod", pass parameters to it and get the result back.

Contributions and feedback

Please feel free to use the component, open issues, fix bugs or provide feedback.

Contributors

The following people are the maintainers of the Blazor Extensions projects:

Showing the top 2 GitHub repositories that depend on Blazor.Extensions.SignalR:

Repository Stars
cloudnative-netcore/netcorekit
:heartpulse: A crafted toolkit for building cloud-native apps on the .NET platform
anuraj/AspNetCoreSamples
This repository is set of ASP.NET Core projects and scripts.

Version History

Version Downloads Last updated
0.4.0 113 9/9/2019
0.3.0 353 8/16/2019
0.2.0 691 7/28/2019
0.1.10 299 7/3/2019
0.1.9 1,477 5/1/2019
0.1.8 3,984 11/26/2018
0.1.7 3,504 10/4/2018
0.1.6 359 9/26/2018
0.1.5 1,295 7/29/2018
0.1.4 216 7/28/2018
0.1.3 219 7/19/2018
0.1.2 192 7/17/2018
0.1.1 232 7/16/2018
0.1.0 268 7/15/2018