-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SignalR as websocket presentation (#41)
- Loading branch information
Showing
39 changed files
with
351 additions
and
76 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 |
---|---|---|
|
@@ -24,12 +24,22 @@ jobs: | |
run: dotnet build -c Release --no-restore | ||
- name: Application Test | ||
run: dotnet test ./tests/NKZSoft.Template.Application.Tests --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage | ||
# - name: REST Test | ||
# run: dotnet test ./tests/NKZSoft.Template.Presentation.REST.Tests --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage | ||
- name: REST Test | ||
run: dotnet test ./tests/NKZSoft.Template.Presentation.REST.Tests --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage | ||
- name: GraphQL Test | ||
run: dotnet test ./tests/NKZSoft.Template.Presentation.GraphQL.Tests --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage | ||
- name: SignalR Test | ||
run: dotnet test ./tests/NKZSoft.Template.Presentation.SignalR.Tests --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage | ||
- name: GRPC Test | ||
run: dotnet test ./tests/NKZSoft.Template.Presentation.GRPC.Tests --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage | ||
- name: Merge test results | ||
run: | | ||
dotnet tool install -g dotnet-reportgenerator-globaltool | ||
reportgenerator "-reports:coverage/**/coverage.cobertura.xml" "-targetdir:coverage/result" -reporttypes:Cobertura | ||
- name: Code Coverage Report | ||
uses: irongut/[email protected] | ||
with: | ||
filename: coverage/**/coverage.cobertura.xml | ||
filename: coverage/result/*.xml | ||
badge: true | ||
fail_below_min: true | ||
format: markdown | ||
|
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 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 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 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 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 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 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
17 changes: 17 additions & 0 deletions
17
src/NKZSoft.Template.Presentation.SignalR/Extensions/EndpointRouteBuilderExtension.cs
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,17 @@ | ||
namespace NKZSoft.Template.Presentation.SignalR.Extensions; | ||
|
||
using Hubs; | ||
|
||
public static class EndpointRouteBuilderExtension | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="endpointRouteBuilder"></param> | ||
/// <returns></returns> | ||
public static IEndpointRouteBuilder MapHubEndpoints(this IEndpointRouteBuilder endpointRouteBuilder) | ||
{ | ||
endpointRouteBuilder.MapHub<ToDoItemHub>("/" + nameof(ToDoItemHub)); | ||
return endpointRouteBuilder; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/NKZSoft.Template.Presentation.SignalR/Extensions/ServiceCollectionExtension.cs
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,15 @@ | ||
namespace NKZSoft.Template.Presentation.SignalR.Extensions; | ||
|
||
public static class ServiceCollectionExtension | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="services"></param> | ||
/// <returns></returns> | ||
public static IServiceCollection AddSignalRPresentation(this IServiceCollection services) | ||
{ | ||
services.AddSignalR(); | ||
return services; | ||
} | ||
} |
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,8 @@ | ||
// Global using directives | ||
|
||
global using System.Threading.Tasks; | ||
global using Microsoft.AspNetCore.Builder; | ||
global using Microsoft.AspNetCore.Routing; | ||
global using Microsoft.AspNetCore.SignalR; | ||
global using Microsoft.Extensions.DependencyInjection; | ||
global using NKZSoft.Template.Application.Models; |
10 changes: 10 additions & 0 deletions
10
src/NKZSoft.Template.Presentation.SignalR/Hubs/ToDoItemHub.cs
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,10 @@ | ||
namespace NKZSoft.Template.Presentation.SignalR.Hubs; | ||
|
||
public sealed class ToDoItemHub : Hub | ||
{ | ||
public async Task<Guid> ToDoItemUpdated(ToDoItemDto toDoItemDto) | ||
{ | ||
await Clients.All.SendAsync(nameof(ToDoItemUpdated), toDoItemDto); | ||
return toDoItemDto.Id; | ||
} | ||
} |
Oops, something went wrong.