-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49602d4
commit 9decde9
Showing
26 changed files
with
337 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
queue: 'Hosted VS2017' | ||
|
||
variables: | ||
buildConfiguration: 'Release' | ||
|
||
steps: | ||
|
||
- task: DotNetCoreCLI@2 | ||
inputs: | ||
command: 'restore' | ||
projects: '**/*.csproj' | ||
|
||
- task: DotNetCoreCLI@2 | ||
inputs: | ||
command: 'build' | ||
projects: '**/*.csproj' | ||
arguments: '--configuration $(buildConfiguration)' | ||
|
||
- task: DotNetCoreCLI@2 | ||
inputs: | ||
command: pack | ||
packagesToPack: 'src/Blazor.Extensions.SignalR/*.csproj' | ||
configuration: '$(buildConfiguration)' | ||
versioningScheme: byPrereleaseNumber | ||
majorVersion: '0' | ||
minorVersion: '1' | ||
patchVersion: '0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
queue: 'Hosted VS2017' | ||
|
||
variables: | ||
buildConfiguration: 'Release' | ||
|
||
steps: | ||
|
||
- task: DotNetCoreCLI@2 | ||
inputs: | ||
command: 'restore' | ||
projects: '**/*.csproj' | ||
|
||
- task: DotNetCoreCLI@2 | ||
inputs: | ||
command: 'build' | ||
projects: '**/*.csproj' | ||
arguments: '--configuration $(buildConfiguration)' | ||
|
||
- task: DotNetCoreCLI@2 | ||
inputs: | ||
command: pack | ||
packagesToPack: 'src/Blazor.Extensions.SignalR/*.csproj' | ||
packDirectory: '$(build.artifactStagingDirectory)' | ||
configuration: '$(buildConfiguration)' | ||
versioningScheme: byEnvVar | ||
versionEnvVar: Version | ||
|
||
- task: NuGetCommand@2 | ||
inputs: | ||
command: push | ||
packagesToPush: '$(build.artifactStagingDirectory)/*.nupkg' | ||
publishFeedCredentials: 'OSS' | ||
nuGetFeedType: external | ||
versioningScheme: byEnvVar | ||
versionEnvVar: Version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,55 @@ | ||
# SignalR | ||
SignalR Core support for Microsoft AspNet Core Blazor | ||
<!---[](https://ci.dot.net/job/dotnet_orleans/job/master/)--> | ||
[](https://www.nuget.org/packages/Blazor.Extensions.SignalR) | ||
[](https://www.nuget.org/packages/Blazor.Extensions.SignalR) | ||
[](https://github.com/BlazorExtensions/SignalR/blob/master/LICENSE) | ||
|
||
# Blazor Extensions | ||
|
||
Blazor Extensions is a set of packages with the goal of adding useful features to [Blazor](https://blazor.net). | ||
|
||
# Blazor Extensions SignalR | ||
|
||
This package adds a [Microsoft ASP.NET Core SignalR](https://github.com/aspnet/SignalR) client library for [Microsoft ASP.NET Blazor](https://github.com/aspnet/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](https://docs.microsoft.com/en-us/aspnet/core/signalr/introduction?view=aspnetcore-2.1). | ||
|
||
# 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. | ||
|
||
```c# | ||
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: | ||
|
||
- [Attila Hajdrik](https://github.com/attilah) | ||
- [Gutemberg Ribiero](https://github.com/galvesribeiro) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
using System; | ||
|
||
namespace Blazor.Extensions | ||
{ | ||
public class HttpConnectionOptions | ||
|
Oops, something went wrong.