├── 2_Advanced ├── 08-1_Authorization │ ├── Pages │ │ ├── _ViewStart.cshtml │ │ ├── Privacy.cshtml │ │ ├── Shared │ │ │ ├── _ValidationScriptsPartial.cshtml │ │ │ └── _LoginPartial.cshtml │ │ ├── _ViewImports.cshtml │ │ ├── Index.cshtml │ │ ├── Index.cshtml.cs │ │ ├── Privacy.cshtml.cs │ │ ├── Error.cshtml │ │ └── Error.cshtml.cs │ ├── tsconfig.json │ ├── Areas │ │ └── Identity │ │ │ └── Pages │ │ │ └── _ViewStart.cshtml │ ├── app.db │ ├── wwwroot │ │ ├── favicon.ico │ │ ├── webpack-assets.json │ │ ├── js │ │ │ └── site.js │ │ └── lib │ │ │ └── jquery-validation-unobtrusive │ │ │ └── LICENSE.txt │ ├── Client │ │ └── Template │ │ │ ├── favicon.ico │ │ │ ├── js │ │ │ └── site.js │ │ │ └── lib │ │ │ └── jquery-validation-unobtrusive │ │ │ └── LICENSE.txt │ ├── 5.0.0 │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Hubs │ │ └── ColorHub.cs │ ├── Data │ │ └── ApplicationDbContext.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ └── package.json ├── 02_MessagePack │ ├── tsconfig.json │ ├── Services │ │ ├── IRandomUserService.cs │ │ └── RandomUserService.cs │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Models │ │ ├── Id.cs │ │ ├── Dob.cs │ │ ├── Registered.cs │ │ ├── Street.cs │ │ ├── Timezone.cs │ │ ├── Coordinates.cs │ │ ├── RandomUserRoot.cs │ │ ├── Name.cs │ │ ├── Picture.cs │ │ ├── Info.cs │ │ ├── Login.cs │ │ └── Location.cs │ ├── client │ │ └── index.html │ ├── wwwroot │ │ └── index.html │ ├── Hubs │ │ └── UserHub.cs │ ├── Scaffold.Web.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ └── package.json ├── 12_RedisBackplane │ ├── tsconfig.json │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Hubs │ │ └── BackgroundColorHub.cs │ ├── client │ │ └── index.html │ ├── wwwroot │ │ └── index.html │ ├── Scaffold.Web.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ └── package.json ├── 13_HostedServices │ ├── tsconfig.json │ ├── Hubs │ │ └── TimeHub.cs │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── client │ │ ├── index.html │ │ └── index.ts │ ├── wwwroot │ │ └── index.html │ ├── Scaffold.Web.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ └── package.json ├── 03_StronglyTypedHubs │ ├── tsconfig.json │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── client │ │ ├── index.html │ │ └── index.ts │ ├── wwwroot │ │ └── index.html │ ├── Hubs │ │ └── ViewHub.cs │ ├── Scaffold.Web.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ └── package.json ├── 14_dotnetClient │ ├── Server │ │ ├── tsconfig.json │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── Hubs │ │ │ └── BackgroundColorHub.cs │ │ ├── client │ │ │ └── index.html │ │ ├── wwwroot │ │ │ └── index.html │ │ ├── Scaffold.Web.csproj │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ └── package.json │ └── DotNetClient │ │ ├── DotNetClient.csproj │ │ └── .vscode │ │ └── launch.json ├── 01-1 Client Connection Events │ ├── tsconfig.json │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Hubs │ │ └── ViewHub.cs │ ├── client │ │ └── index.html │ ├── wwwroot │ │ └── index.html │ ├── Scaffold.Web.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ └── package.json ├── 01-2 Server Connection Events │ ├── tsconfig.json │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── client │ │ ├── index.html │ │ └── index.ts │ ├── wwwroot │ │ └── index.html │ ├── Scaffold.Web.csproj │ ├── Hubs │ │ └── ViewHub.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ └── package.json ├── 15_MultipleHubConnections │ ├── tsconfig.json │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Hubs │ │ ├── BackgroundColorHub.cs │ │ └── TimeHub.cs │ ├── client │ │ └── index.html │ ├── wwwroot │ │ └── index.html │ ├── Scaffold.Web.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ └── package.json └── 11_AzureSignalRService │ └── 11_1-DefaultModeWithASPNETCore │ ├── tsconfig.json │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Hubs │ └── BackgroundColorHub.cs │ ├── client │ └── index.html │ ├── wwwroot │ └── index.html │ ├── Scaffold.Web.csproj │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ └── package.json ├── Demos └── todo-application │ ├── realtimetodo.client │ ├── .browserslistrc │ ├── babel.config.js │ ├── src │ │ ├── shims-vue.d.ts │ │ ├── assets │ │ │ └── logo.png │ │ ├── main.ts │ │ ├── shims-tsx.d.ts │ │ ├── @types │ │ │ └── service.d.ts │ │ ├── App.vue │ │ └── router │ │ │ └── index.ts │ ├── public │ │ ├── favicon.ico │ │ └── index.html │ ├── .gitignore │ ├── README.md │ ├── .eslintrc.js │ └── tsconfig.json │ └── RealTimeTodo.Web │ ├── Model │ ├── ToDoItem.cs │ └── ToDoListMinimal.cs │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Services │ └── IToDoRepository.cs │ ├── RealTimeTodo.Web.csproj │ └── Properties │ └── launchSettings.json ├── 1_Essentials ├── 11_Groups │ ├── tsconfig.json │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Hubs │ │ └── ColorHub.cs │ ├── Scaffold.Web.csproj │ ├── client │ │ └── index.html │ ├── wwwroot │ │ └── index.html │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── package.json │ └── webpack.config.js ├── 2_Logging │ ├── tsconfig.json │ ├── .upgrade-assistant │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── client │ │ ├── customLogger.ts │ │ ├── index.html │ │ └── index.ts │ ├── Hubs │ │ └── ViewHub.cs │ ├── wwwroot │ │ └── index.html │ ├── Scaffold.Web.csproj │ ├── Properties │ │ └── launchSettings.json │ ├── package.json │ ├── Program.cs │ └── webpack.config.js ├── 12_MessageSizes │ ├── tsconfig.json │ ├── Services │ │ ├── IRandomUserService.cs │ │ └── RandomUserService.cs │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Models │ │ ├── Id.cs │ │ ├── Dob.cs │ │ ├── Street.cs │ │ ├── Registered.cs │ │ ├── Timezone.cs │ │ ├── Coordinates.cs │ │ ├── RandomUserRoot.cs │ │ ├── Name.cs │ │ ├── Picture.cs │ │ ├── Info.cs │ │ ├── Login.cs │ │ └── Location.cs │ ├── Scaffold.Web.csproj │ ├── client │ │ └── index.html │ ├── Hubs │ │ └── UserHub.cs │ ├── wwwroot │ │ └── index.html │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── package.json │ └── webpack.config.js ├── 14_HubLifecycle │ ├── tsconfig.json │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Services │ │ ├── IVoteManager.cs │ │ └── VoteManager.cs │ ├── client │ │ ├── index.html │ │ └── index.ts │ ├── Scaffold.Web.csproj │ ├── wwwroot │ │ └── index.html │ ├── Hubs │ │ └── VoteHub.cs │ ├── Properties │ │ └── launchSettings.json │ ├── package.json │ ├── Program.cs │ └── webpack.config.js ├── 15_Reconnection │ ├── tsconfig.json │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Hubs │ │ └── ViewHub.cs │ ├── client │ │ ├── index.html │ │ ├── CustomRetryPolicy.ts │ │ └── index.ts │ ├── wwwroot │ │ └── index.html │ ├── Scaffold.Web.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ └── package.json ├── 8_ClientEvents │ ├── tsconfig.json │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Hubs │ │ └── ViewHub.cs │ ├── client │ │ ├── index.html │ │ └── index.ts │ ├── Scaffold.Web.csproj │ ├── wwwroot │ │ └── index.html │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ └── package.json ├── 16_DependencyInjection │ ├── tsconfig.json │ ├── Services │ │ ├── IRandomUserService.cs │ │ └── RandomUserService.cs │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Models │ │ ├── Id.cs │ │ ├── Dob.cs │ │ ├── Registered.cs │ │ ├── Street.cs │ │ ├── Timezone.cs │ │ ├── Coordinates.cs │ │ ├── RandomUserRoot.cs │ │ ├── Name.cs │ │ ├── Picture.cs │ │ ├── Info.cs │ │ ├── Login.cs │ │ └── Location.cs │ ├── Scaffold.Web.csproj │ ├── client │ │ └── index.html │ ├── wwwroot │ │ └── index.html │ ├── Hubs │ │ └── UserHub.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ └── package.json ├── 1_BasicClientServer │ ├── tsconfig.json │ ├── Scaffold.Web.csproj │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Hubs │ │ └── ViewHub.cs │ ├── client │ │ ├── index.html │ │ └── index.ts │ ├── wwwroot │ │ └── index.html │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ └── package.json ├── 7_CallingHubMethods │ ├── tsconfig.json │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Hubs │ │ └── StringToolsHub.cs │ ├── client │ │ ├── index.html │ │ └── index.ts │ ├── Scaffold.Web.csproj │ ├── wwwroot │ │ └── index.html │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ └── package.json ├── 13_HubContextOutsideHub │ ├── tsconfig.json │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Services │ │ ├── IVoteManager.cs │ │ └── VoteManager.cs │ ├── client │ │ ├── index.html │ │ └── index.ts │ ├── Hubs │ │ └── VoteHub.cs │ ├── Scaffold.Web.csproj │ ├── wwwroot │ │ └── index.html │ ├── Controllers │ │ └── VoteController.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ └── package.json └── 5_ChoosingTransportType │ ├── tsconfig.json │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Hubs │ └── ViewHub.cs │ ├── client │ ├── index.html │ └── index.ts │ ├── wwwroot │ └── index.html │ ├── Scaffold.Web.csproj │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ └── package.json ├── renovate.json ├── Clean.ps1 ├── Presentations └── RealTimeRevolution │ └── src │ ├── END │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── src.csproj │ ├── wwwroot │ │ ├── package.json │ │ └── index.html │ ├── package-lock.json │ ├── Hubs │ │ └── SyncHub.cs │ ├── Program.cs │ └── Properties │ │ └── launchSettings.json │ └── START │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── src.csproj │ ├── wwwroot │ ├── package.json │ ├── index.js │ └── index.html │ ├── package-lock.json │ ├── Program.cs │ └── Properties │ └── launchSettings.json ├── Scaffold NPM Commands.md ├── Upgrade.ps1 └── README.md /2_Advanced/08-1_Authorization/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /Demos/todo-application/realtimetodo.client/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not dead 4 | -------------------------------------------------------------------------------- /1_Essentials/11_Groups/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | } 5 | } -------------------------------------------------------------------------------- /1_Essentials/2_Logging/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | } 5 | } -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | } 5 | } -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | } 5 | } -------------------------------------------------------------------------------- /1_Essentials/14_HubLifecycle/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | } 5 | } -------------------------------------------------------------------------------- /1_Essentials/15_Reconnection/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | } 5 | } -------------------------------------------------------------------------------- /1_Essentials/8_ClientEvents/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | } 5 | } -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | } 5 | } -------------------------------------------------------------------------------- /2_Advanced/12_RedisBackplane/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | } 5 | } -------------------------------------------------------------------------------- /2_Advanced/13_HostedServices/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | } 5 | } -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | } 5 | } -------------------------------------------------------------------------------- /1_Essentials/1_BasicClientServer/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | } 5 | } -------------------------------------------------------------------------------- /1_Essentials/7_CallingHubMethods/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | } 5 | } -------------------------------------------------------------------------------- /2_Advanced/03_StronglyTypedHubs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | } 5 | } -------------------------------------------------------------------------------- /2_Advanced/14_dotnetClient/Server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | } 5 | } -------------------------------------------------------------------------------- /1_Essentials/13_HubContextOutsideHub/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | } 5 | } -------------------------------------------------------------------------------- /1_Essentials/5_ChoosingTransportType/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | } 5 | } -------------------------------------------------------------------------------- /2_Advanced/01-1 Client Connection Events/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | } 5 | } -------------------------------------------------------------------------------- /2_Advanced/01-2 Server Connection Events/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | } 5 | } -------------------------------------------------------------------------------- /2_Advanced/15_MultipleHubConnections/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | } 5 | } -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/Areas/Identity/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "/Pages/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/app.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1kevgriff/SignalR-Mastery/main/2_Advanced/08-1_Authorization/app.db -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:base" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /2_Advanced/11_AzureSignalRService/11_1-DefaultModeWithASPNETCore/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" 4 | } 5 | } -------------------------------------------------------------------------------- /Demos/todo-application/realtimetodo.client/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /Demos/todo-application/realtimetodo.client/src/shims-vue.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.vue' { 2 | import Vue from 'vue' 3 | export default Vue 4 | } 5 | -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1kevgriff/SignalR-Mastery/main/2_Advanced/08-1_Authorization/wwwroot/favicon.ico -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/Client/Template/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1kevgriff/SignalR-Mastery/main/2_Advanced/08-1_Authorization/Client/Template/favicon.ico -------------------------------------------------------------------------------- /Demos/todo-application/realtimetodo.client/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1kevgriff/SignalR-Mastery/main/Demos/todo-application/realtimetodo.client/public/favicon.ico -------------------------------------------------------------------------------- /2_Advanced/13_HostedServices/Hubs/TimeHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.SignalR; 5 | 6 | public class TimeHub : Hub 7 | { 8 | } -------------------------------------------------------------------------------- /Demos/todo-application/realtimetodo.client/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1kevgriff/SignalR-Mastery/main/Demos/todo-application/realtimetodo.client/src/assets/logo.png -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/wwwroot/webpack-assets.json: -------------------------------------------------------------------------------- 1 | {"main":{"js":["/vendors-node_modules_microsoft_signalr_dist_esm_index_js.6e741fc33183c524ddd2.js","/main.92a76c86870b0291e715.js"]}} -------------------------------------------------------------------------------- /1_Essentials/2_Logging/.upgrade-assistant: -------------------------------------------------------------------------------- 1 | {"Build":"0.3.255803\u002Bd72527aefab54bfbadc3227b4f1ffd326c1e9a8a","CurrentProject":"Scaffold.Web.csproj","EntryPoints":["Scaffold.Web.csproj"],"Properties":{}} -------------------------------------------------------------------------------- /Clean.ps1: -------------------------------------------------------------------------------- 1 | Get-ChildItem . -recurse -include bin | remove-item -recurse 2 | Get-ChildItem . -recurse -include obj | remove-item -recurse 3 | Get-ChildItem . -recurse -include node_modules | remove-item -recurse -------------------------------------------------------------------------------- /Demos/todo-application/RealTimeTodo.Web/Model/ToDoItem.cs: -------------------------------------------------------------------------------- 1 | public class ToDoItem 2 | { 3 | public int Id {get;set;} 4 | public string Text { get; set; } 5 | public bool IsCompleted { get; set; } 6 | } -------------------------------------------------------------------------------- /1_Essentials/1_BasicClientServer/Scaffold.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/5.0.0: -------------------------------------------------------------------------------- 1 | + webpack@4.46.0 2 | updated 1 package and audited 617 packages in 7.579s 3 | 4 | 35 packages are looking for funding 5 | run `npm fund` for details 6 | 7 | found 0 vulnerabilities 8 | 9 | -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/Pages/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model PrivacyModel 3 | @{ 4 | ViewData["Title"] = "Privacy Policy"; 5 | } 6 |

@ViewData["Title"]

7 | 8 |

Use this page to detail your site's privacy policy.

9 | -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/Services/IRandomUserService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | 4 | public interface IRandomUserService 5 | { 6 | Task> GetUsers(int max = 10); 7 | } 8 | -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/Services/IRandomUserService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | 4 | public interface IRandomUserService 5 | { 6 | Task> GetUsers(int max = 10); 7 | } 8 | -------------------------------------------------------------------------------- /1_Essentials/11_Groups/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/Services/IRandomUserService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | 4 | public interface IRandomUserService 5 | { 6 | Task> GetUsers(int max = 10); 7 | } 8 | -------------------------------------------------------------------------------- /1_Essentials/2_Logging/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/Pages/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /1_Essentials/14_HubLifecycle/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /1_Essentials/15_Reconnection/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /1_Essentials/8_ClientEvents/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /2_Advanced/12_RedisBackplane/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /2_Advanced/13_HostedServices/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /1_Essentials/1_BasicClientServer/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /1_Essentials/7_CallingHubMethods/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /2_Advanced/03_StronglyTypedHubs/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /2_Advanced/14_dotnetClient/Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Demos/todo-application/RealTimeTodo.Web/Model/ToDoListMinimal.cs: -------------------------------------------------------------------------------- 1 | public class ToDoListMinimal 2 | { 3 | public int Id { get; set; } 4 | public string Name { get; set; } 5 | public int Pending { get; set; } 6 | public int Completed { get; set; } 7 | } -------------------------------------------------------------------------------- /1_Essentials/11_Groups/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /1_Essentials/13_HubContextOutsideHub/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /1_Essentials/2_Logging/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /1_Essentials/5_ChoosingTransportType/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /2_Advanced/15_MultipleHubConnections/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Demos/todo-application/RealTimeTodo.Web/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /1_Essentials/14_HubLifecycle/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /1_Essentials/15_Reconnection/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /1_Essentials/8_ClientEvents/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /2_Advanced/01-1 Client Connection Events/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /2_Advanced/01-2 Server Connection Events/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /2_Advanced/12_RedisBackplane/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /2_Advanced/13_HostedServices/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /Presentations/RealTimeRevolution/src/END/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Presentations/RealTimeRevolution/src/START/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /1_Essentials/1_BasicClientServer/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /1_Essentials/7_CallingHubMethods/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /2_Advanced/03_StronglyTypedHubs/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /2_Advanced/14_dotnetClient/Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /1_Essentials/13_HubContextOutsideHub/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /1_Essentials/5_ChoosingTransportType/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /2_Advanced/15_MultipleHubConnections/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /2_Advanced/01-1 Client Connection Events/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /2_Advanced/01-2 Server Connection Events/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Identity 2 | @using _08_1_Authorization 3 | @using _08_1_Authorization.Data 4 | @namespace _08_1_Authorization.Pages 5 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 6 | @addTagHelper *, WebpackTag 7 | -------------------------------------------------------------------------------- /Demos/todo-application/RealTimeTodo.Web/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /Presentations/RealTimeRevolution/src/END/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /Presentations/RealTimeRevolution/src/START/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/Client/Template/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft": "Warning", 7 | "Microsoft.Hosting.Lifetime": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /2_Advanced/11_AzureSignalRService/11_1-DefaultModeWithASPNETCore/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Scaffold NPM Commands.md: -------------------------------------------------------------------------------- 1 | Are you here from the Scaffold lesson in SignalR Mastery? This is the command I used! 2 | 3 | > npm install -D -E clean-webpack-plugin@3.0.0 css-loader@3.4.0 html-webpack-plugin@3.2.0 mini-css-extract-plugin@0.9.0 ts-loader@6.2.1 typescript@3.7.5 webpack@4.41.5 webpack-cli@3.3.10 4 | -------------------------------------------------------------------------------- /1_Essentials/14_HubLifecycle/Services/IVoteManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using Microsoft.AspNetCore.SignalR; 4 | 5 | public interface IVoteManager 6 | { 7 | Task CastVote(string voteFor); 8 | Dictionary GetCurrentVotes(); 9 | } 10 | -------------------------------------------------------------------------------- /2_Advanced/11_AzureSignalRService/11_1-DefaultModeWithASPNETCore/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /1_Essentials/13_HubContextOutsideHub/Services/IVoteManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using Microsoft.AspNetCore.SignalR; 4 | 5 | public interface IVoteManager 6 | { 7 | Task CastVote(string voteFor); 8 | Dictionary GetCurrentVotes(); 9 | } 10 | -------------------------------------------------------------------------------- /1_Essentials/7_CallingHubMethods/Hubs/StringToolsHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.SignalR; 5 | 6 | public class StringToolsHub : Hub 7 | { 8 | public string GetFullName(string firstName, string lastName){ 9 | return $"{firstName} {lastName}"; 10 | } 11 | } -------------------------------------------------------------------------------- /2_Advanced/12_RedisBackplane/Hubs/BackgroundColorHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.SignalR; 5 | 6 | public class BackgroundColorHub : Hub 7 | { 8 | public async Task ChangeBackground(string color){ 9 | await this.Clients.All.SendAsync("changeBackground", color); 10 | } 11 | } -------------------------------------------------------------------------------- /2_Advanced/15_MultipleHubConnections/Hubs/BackgroundColorHub.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Microsoft.AspNetCore.SignalR; 3 | 4 | public class BackgroundColorHub : Hub 5 | { 6 | public async Task ChangeBackground(string color) 7 | { 8 | await this.Clients.All.SendAsync("changeBackground", color); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /2_Advanced/15_MultipleHubConnections/Hubs/TimeHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.SignalR; 5 | 6 | public class TimeHub : Hub 7 | { 8 | public async Task GetCurrentTime() 9 | { 10 | await Clients.Caller.SendAsync("UpdatedTime", DateTime.UtcNow.ToString("F")); 11 | } 12 | } -------------------------------------------------------------------------------- /2_Advanced/14_dotnetClient/Server/Hubs/BackgroundColorHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.SignalR; 5 | 6 | public class BackgroundColorHub : Hub 7 | { 8 | public async Task ChangeBackground(string color){ 9 | await this.Clients.All.SendAsync("changeBackground", color); 10 | } 11 | } -------------------------------------------------------------------------------- /1_Essentials/2_Logging/client/customLogger.ts: -------------------------------------------------------------------------------- 1 | import { ILogger, LogLevel } from "@microsoft/signalr"; 2 | 3 | export class CustomLogger implements ILogger { 4 | log(logLevel: LogLevel, message: string) { 5 | // Use `message` and `logLevel` to record the log message to your own system 6 | console.log(`${logLevel} :: ${message}`); 7 | } 8 | } -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/Models/Id.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Id 5 | { 6 | [JsonPropertyName("name")] 7 | public string Name { get; set; } 8 | 9 | [JsonPropertyName("value")] 10 | public string Value { get; set; } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/Models/Id.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Id 5 | { 6 | [JsonPropertyName("name")] 7 | public string Name { get; set; } 8 | 9 | [JsonPropertyName("value")] 10 | public string Value { get; set; } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultConnection": "DataSource=app.db;Cache=Shared" 4 | }, 5 | "Logging": { 6 | "LogLevel": { 7 | "Default": "Information", 8 | "Microsoft": "Warning", 9 | "Microsoft.Hosting.Lifetime": "Information" 10 | } 11 | }, 12 | "AllowedHosts": "*" 13 | } 14 | -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/Models/Id.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Id 5 | { 6 | [JsonPropertyName("name")] 7 | public string Name { get; set; } 8 | 9 | [JsonPropertyName("value")] 10 | public string Value { get; set; } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /Demos/todo-application/realtimetodo.client/src/main.ts: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | import { ConnectionServices } from './services/toDoService'; 5 | 6 | Vue.config.productionTip = false 7 | 8 | 9 | Vue.use(ConnectionServices); 10 | 11 | new Vue({ 12 | router, 13 | render: h => h(App) 14 | }).$mount('#app') 15 | -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/Models/Dob.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System; 3 | using System.Text.Json.Serialization; 4 | 5 | public class Dob 6 | { 7 | [JsonPropertyName("date")] 8 | public DateTime Date { get; set; } 9 | 10 | [JsonPropertyName("age")] 11 | public int Age { get; set; } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/Models/Dob.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System; 3 | using System.Text.Json.Serialization; 4 | 5 | public class Dob 6 | { 7 | [JsonPropertyName("date")] 8 | public DateTime Date { get; set; } 9 | 10 | [JsonPropertyName("age")] 11 | public int Age { get; set; } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /2_Advanced/11_AzureSignalRService/11_1-DefaultModeWithASPNETCore/Hubs/BackgroundColorHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.SignalR; 5 | 6 | public class BackgroundColorHub : Hub 7 | { 8 | public async Task ChangeBackground(string color){ 9 | await this.Clients.All.SendAsync("changeBackground", color); 10 | } 11 | } -------------------------------------------------------------------------------- /Demos/todo-application/realtimetodo.client/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/Models/Street.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Street { 5 | [JsonPropertyName("number")] 6 | public int Number { get; set; } 7 | 8 | [JsonPropertyName("name")] 9 | public string Name { get; set; } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/Models/Dob.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System; 3 | using System.Text.Json.Serialization; 4 | 5 | public class Dob 6 | { 7 | [JsonPropertyName("date")] 8 | public DateTime Date { get; set; } 9 | 10 | [JsonPropertyName("age")] 11 | public int Age { get; set; } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/Models/Registered.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System; 3 | using System.Text.Json.Serialization; 4 | 5 | public class Registered 6 | { 7 | [JsonPropertyName("date")] 8 | public DateTime Date { get; set; } 9 | 10 | [JsonPropertyName("age")] 11 | public int Age { get; set; } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/Models/Street.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Street { 5 | [JsonPropertyName("number")] 6 | public int Number { get; set; } 7 | 8 | [JsonPropertyName("name")] 9 | public string Name { get; set; } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/Models/Timezone.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Timezone 5 | { 6 | [JsonPropertyName("offset")] 7 | public string Offset { get; set; } 8 | 9 | [JsonPropertyName("description")] 10 | public string Description { get; set; } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/Models/Registered.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System; 3 | using System.Text.Json.Serialization; 4 | 5 | public class Registered 6 | { 7 | [JsonPropertyName("date")] 8 | public DateTime Date { get; set; } 9 | 10 | [JsonPropertyName("age")] 11 | public int Age { get; set; } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/Models/Timezone.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Timezone 5 | { 6 | [JsonPropertyName("offset")] 7 | public string Offset { get; set; } 8 | 9 | [JsonPropertyName("description")] 10 | public string Description { get; set; } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /1_Essentials/2_Logging/Hubs/ViewHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.SignalR; 5 | 6 | public class ViewHub : Hub 7 | { 8 | public static int ViewCount {get;set;} = 0; 9 | 10 | public async Task NotifyWatching(){ 11 | ViewCount++; 12 | 13 | await this.Clients.All.SendAsync("viewCountUpdate", ViewCount); 14 | } 15 | } -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/Models/Coordinates.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Coordinates 5 | { 6 | [JsonPropertyName("latitude")] 7 | public string Latitude { get; set; } 8 | 9 | [JsonPropertyName("longitude")] 10 | public string Longitude { get; set; } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /Demos/todo-application/RealTimeTodo.Web/Services/IToDoRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | 4 | public interface IToDoRepository 5 | { 6 | Task> GetLists(); 7 | Task GetList(int id); 8 | 9 | Task AddToDoItem(int listId, string text); 10 | Task ToggleToDoItem(int listId, int itemId); 11 | } 12 | -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/Models/Coordinates.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Coordinates 5 | { 6 | [JsonPropertyName("latitude")] 7 | public string Latitude { get; set; } 8 | 9 | [JsonPropertyName("longitude")] 10 | public string Longitude { get; set; } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /1_Essentials/15_Reconnection/Hubs/ViewHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.SignalR; 5 | 6 | public class ViewHub : Hub 7 | { 8 | public static int ViewCount {get;set;} = 0; 9 | 10 | public async Task NotifyWatching(){ 11 | ViewCount++; 12 | 13 | await this.Clients.All.SendAsync("viewCountUpdate", ViewCount); 14 | } 15 | } -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/Models/Registered.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System; 3 | using System.Text.Json.Serialization; 4 | 5 | public class Registered 6 | { 7 | [JsonPropertyName("date")] 8 | public DateTime Date { get; set; } 9 | 10 | [JsonPropertyName("age")] 11 | public int Age { get; set; } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/Models/Street.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Street { 5 | [JsonPropertyName("number")] 6 | public int Number { get; set; } 7 | 8 | [JsonPropertyName("name")] 9 | public string Name { get; set; } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/Models/Timezone.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Timezone 5 | { 6 | [JsonPropertyName("offset")] 7 | public string Offset { get; set; } 8 | 9 | [JsonPropertyName("description")] 10 | public string Description { get; set; } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /2_Advanced/13_HostedServices/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

What Time Is It?

12 |

It is: 00:00:00

13 | 14 | 15 | -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/Models/Coordinates.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Coordinates 5 | { 6 | [JsonPropertyName("latitude")] 7 | public string Latitude { get; set; } 8 | 9 | [JsonPropertyName("longitude")] 10 | public string Longitude { get; set; } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /1_Essentials/1_BasicClientServer/Hubs/ViewHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.SignalR; 5 | 6 | public class ViewHub : Hub 7 | { 8 | public static int ViewCount {get;set;} = 0; 9 | 10 | public async Task NotifyWatching(){ 11 | ViewCount++; 12 | 13 | await this.Clients.All.SendAsync("viewCountUpdate", ViewCount); 14 | } 15 | } -------------------------------------------------------------------------------- /1_Essentials/2_Logging/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

SignalR Scaffold

12 |

People watching this page: 0

13 | 14 | 15 | -------------------------------------------------------------------------------- /1_Essentials/8_ClientEvents/Hubs/ViewHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.SignalR; 5 | 6 | public class ViewHub : Hub 7 | { 8 | private static int ViewCount {get;set;} = 0; 9 | 10 | public Task IncrementServerView() 11 | { 12 | ViewCount++; 13 | 14 | return Clients.All.SendAsync("incrementView", ViewCount); 15 | } 16 | } -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/Hubs/ColorHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Threading.Tasks; 3 | using Microsoft.AspNetCore.Authorization; 4 | using Microsoft.AspNetCore.SignalR; 5 | 6 | [Authorize()] 7 | public class ColorHub : Hub 8 | { 9 | [Authorize(Roles="ADMIN")] 10 | public Task ChangeBackground(string color){ 11 | 12 | return Clients.All.SendAsync("changeBackground", color); 13 | } 14 | } -------------------------------------------------------------------------------- /1_Essentials/15_Reconnection/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

SignalR Scaffold

12 |

People watching this page: 0

13 | 14 | 15 | -------------------------------------------------------------------------------- /1_Essentials/5_ChoosingTransportType/Hubs/ViewHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.SignalR; 5 | 6 | public class ViewHub : Hub 7 | { 8 | public static int ViewCount {get;set;} = 0; 9 | 10 | public async Task NotifyWatching(){ 11 | ViewCount++; 12 | 13 | await this.Clients.All.SendAsync("viewCountUpdate", ViewCount); 14 | } 15 | } -------------------------------------------------------------------------------- /2_Advanced/01-1 Client Connection Events/Hubs/ViewHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.SignalR; 5 | 6 | public class ViewHub : Hub 7 | { 8 | public static int ViewCount {get;set;} = 0; 9 | 10 | public async Task NotifyWatching(){ 11 | ViewCount++; 12 | 13 | await this.Clients.All.SendAsync("viewCountUpdate", ViewCount); 14 | } 15 | } -------------------------------------------------------------------------------- /1_Essentials/1_BasicClientServer/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

SignalR Scaffold

12 |

People watching this page: 0

13 | 14 | 15 | -------------------------------------------------------------------------------- /2_Advanced/03_StronglyTypedHubs/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

SignalR Scaffold

12 |

People watching this page: 0

13 | 14 | 15 | -------------------------------------------------------------------------------- /Demos/todo-application/realtimetodo.client/src/shims-tsx.d.ts: -------------------------------------------------------------------------------- 1 | import Vue, { VNode } from 'vue' 2 | 3 | declare global { 4 | namespace JSX { 5 | // tslint:disable no-empty-interface 6 | interface Element extends VNode {} 7 | // tslint:disable no-empty-interface 8 | interface ElementClass extends Vue {} 9 | interface IntrinsicElements { 10 | [elem: string]: any; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /1_Essentials/5_ChoosingTransportType/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

SignalR Scaffold

12 |

People watching this page: 0

13 | 14 | 15 | -------------------------------------------------------------------------------- /2_Advanced/01-1 Client Connection Events/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

SignalR Scaffold

12 |

People watching this page: 0

13 | 14 | 15 | -------------------------------------------------------------------------------- /2_Advanced/01-2 Server Connection Events/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

SignalR Scaffold

12 |

People watching this page: 0

13 | 14 | 15 | -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/Pages/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model IndexModel 3 | @{ 4 | ViewData["Title"] = "Home page"; 5 | } 6 | 7 |
8 |

Authorization Demo

9 |

You can only change background if you're logged in:

10 | 11 | 12 | 13 |
14 | -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/Models/RandomUserRoot.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Collections.Generic; 3 | using System.Text.Json.Serialization; 4 | 5 | public class RandomUserRoot 6 | { 7 | [JsonPropertyName("results")] 8 | public List Results { get; set; } 9 | 10 | [JsonPropertyName("info")] 11 | public Info Info { get; set; } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/Models/RandomUserRoot.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Collections.Generic; 3 | using System.Text.Json.Serialization; 4 | 5 | public class RandomUserRoot 6 | { 7 | [JsonPropertyName("results")] 8 | public List Results { get; set; } 9 | 10 | [JsonPropertyName("info")] 11 | public Info Info { get; set; } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/Models/RandomUserRoot.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Collections.Generic; 3 | using System.Text.Json.Serialization; 4 | 5 | public class RandomUserRoot 6 | { 7 | [JsonPropertyName("results")] 8 | public List Results { get; set; } 9 | 10 | [JsonPropertyName("info")] 11 | public Info Info { get; set; } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/Models/Name.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Name 5 | { 6 | [JsonPropertyName("title")] 7 | public string Title { get; set; } 8 | 9 | [JsonPropertyName("first")] 10 | public string First { get; set; } 11 | 12 | [JsonPropertyName("last")] 13 | public string Last { get; set; } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/Models/Name.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Name 5 | { 6 | [JsonPropertyName("title")] 7 | public string Title { get; set; } 8 | 9 | [JsonPropertyName("first")] 10 | public string First { get; set; } 11 | 12 | [JsonPropertyName("last")] 13 | public string Last { get; set; } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /Demos/todo-application/realtimetodo.client/src/@types/service.d.ts: -------------------------------------------------------------------------------- 1 | import Vue from "vue"; 2 | import { HubConnection } from "@microsoft/signalr" 3 | 4 | declare module 'vue/types/vue' 5 | { 6 | interface Vue { 7 | $connectionService: any; 8 | } 9 | 10 | interface VueConstructor { 11 | $connectionService: any; 12 | } 13 | 14 | interface ComponentOptions { 15 | $connectionService: any 16 | } 17 | } -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/Models/Name.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Name 5 | { 6 | [JsonPropertyName("title")] 7 | public string Title { get; set; } 8 | 9 | [JsonPropertyName("first")] 10 | public string First { get; set; } 11 | 12 | [JsonPropertyName("last")] 13 | public string Last { get; set; } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/Models/Picture.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Picture 5 | { 6 | [JsonPropertyName("large")] 7 | public string Large { get; set; } 8 | 9 | [JsonPropertyName("medium")] 10 | public string Medium { get; set; } 11 | 12 | [JsonPropertyName("thumbnail")] 13 | public string Thumbnail { get; set; } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/Models/Picture.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Picture 5 | { 6 | [JsonPropertyName("large")] 7 | public string Large { get; set; } 8 | 9 | [JsonPropertyName("medium")] 10 | public string Medium { get; set; } 11 | 12 | [JsonPropertyName("thumbnail")] 13 | public string Thumbnail { get; set; } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /1_Essentials/14_HubLifecycle/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Users 8 | 9 | 10 | 11 |

Votes

12 |
13 |

Votes for Pie: 0

14 |

Votes for Bacon: 0

15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /1_Essentials/8_ClientEvents/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Name Concat 8 | 9 | 10 | 11 |

View Count

12 |

13 |

View Count: 0

14 | 15 | 16 |

17 | 18 | 19 | -------------------------------------------------------------------------------- /2_Advanced/13_HostedServices/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

What Time Is It?

12 |

It is: 00:00:00

13 | 14 | 15 | -------------------------------------------------------------------------------- /1_Essentials/13_HubContextOutsideHub/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Users 8 | 9 | 10 | 11 |

Votes

12 |
13 |

Votes for Pie: 0

14 |

Votes for Bacon: 0

15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/Models/Picture.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Picture 5 | { 6 | [JsonPropertyName("large")] 7 | public string Large { get; set; } 8 | 9 | [JsonPropertyName("medium")] 10 | public string Medium { get; set; } 11 | 12 | [JsonPropertyName("thumbnail")] 13 | public string Thumbnail { get; set; } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /1_Essentials/2_Logging/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

SignalR Scaffold

12 |

People watching this page: 0

13 | 14 | 15 | -------------------------------------------------------------------------------- /1_Essentials/11_Groups/Hubs/ColorHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.SignalR; 5 | 6 | public class ColorHub : Hub 7 | { 8 | public async Task JoinGroup(string groupName) 9 | { 10 | await Groups.AddToGroupAsync(Context.ConnectionId, groupName); 11 | } 12 | 13 | public Task TriggerGroup(string groupName) 14 | { 15 | return Clients.Group(groupName).SendAsync("TriggerColor", groupName); 16 | } 17 | } -------------------------------------------------------------------------------- /1_Essentials/15_Reconnection/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

SignalR Scaffold

12 |

People watching this page: 0

13 | 14 | 15 | -------------------------------------------------------------------------------- /1_Essentials/1_BasicClientServer/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

SignalR Scaffold

12 |

People watching this page: 0

13 | 14 | 15 | -------------------------------------------------------------------------------- /2_Advanced/03_StronglyTypedHubs/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

SignalR Scaffold

12 |

People watching this page: 0

13 | 14 | 15 | -------------------------------------------------------------------------------- /Demos/todo-application/realtimetodo.client/README.md: -------------------------------------------------------------------------------- 1 | # realtimetodo.client 2 | 3 | ## Project setup 4 | ``` 5 | npm install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | npm run serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | npm run build 16 | ``` 17 | 18 | ### Lints and fixes files 19 | ``` 20 | npm run lint 21 | ``` 22 | 23 | ### Customize configuration 24 | See [Configuration Reference](https://cli.vuejs.org/config/). 25 | -------------------------------------------------------------------------------- /1_Essentials/5_ChoosingTransportType/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

SignalR Scaffold

12 |

People watching this page: 0

13 | 14 | 15 | -------------------------------------------------------------------------------- /2_Advanced/12_RedisBackplane/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

Change Background

12 |

13 | 14 | 15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /2_Advanced/01-1 Client Connection Events/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

SignalR Scaffold

12 |

People watching this page: 0

13 | 14 | 15 | -------------------------------------------------------------------------------- /2_Advanced/01-2 Server Connection Events/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

SignalR Scaffold

12 |

People watching this page: 0

13 | 14 | 15 | -------------------------------------------------------------------------------- /2_Advanced/14_dotnetClient/Server/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

Change Background

12 |

13 | 14 | 15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /2_Advanced/03_StronglyTypedHubs/Hubs/ViewHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.SignalR; 5 | 6 | public class ViewHub : Hub 7 | { 8 | public static int ViewCount { get; set; } = 0; 9 | 10 | public async Task NotifyWatching() 11 | { 12 | ViewCount++; 13 | 14 | await this.Clients.All.ViewCountUpdate(ViewCount); 15 | } 16 | } 17 | 18 | public interface IHubClient 19 | { 20 | Task NewViewCount(int viewCount); 21 | } -------------------------------------------------------------------------------- /Demos/todo-application/realtimetodo.client/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/essential', 8 | 'eslint:recommended', 9 | '@vue/typescript/recommended' 10 | ], 11 | parserOptions: { 12 | ecmaVersion: 2020 13 | }, 14 | rules: { 15 | 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 16 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off' 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /1_Essentials/7_CallingHubMethods/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Name Concat 8 | 9 | 10 | 11 |

Name Concat

12 |

13 | 14 | 15 | 16 | 17 |

18 | 19 | 20 | -------------------------------------------------------------------------------- /1_Essentials/11_Groups/Scaffold.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | all 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /1_Essentials/2_Logging/Scaffold.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | all 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/Scaffold.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | all 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /1_Essentials/14_HubLifecycle/Scaffold.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | all 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /1_Essentials/15_Reconnection/Scaffold.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | all 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /1_Essentials/8_ClientEvents/Scaffold.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | all 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/Data/ApplicationDbContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | namespace _08_1_Authorization.Data 8 | { 9 | public class ApplicationDbContext : IdentityDbContext 10 | { 11 | public ApplicationDbContext(DbContextOptions options) 12 | : base(options) 13 | { 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /2_Advanced/13_HostedServices/Scaffold.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | all 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /1_Essentials/7_CallingHubMethods/Scaffold.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | all 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /2_Advanced/03_StronglyTypedHubs/Scaffold.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | all 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /2_Advanced/11_AzureSignalRService/11_1-DefaultModeWithASPNETCore/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

Change Background

12 |

13 | 14 | 15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /Demos/todo-application/realtimetodo.client/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 9 | 10 | 24 | -------------------------------------------------------------------------------- /Presentations/RealTimeRevolution/src/END/src.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | all 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Presentations/RealTimeRevolution/src/START/src.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | all 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /1_Essentials/13_HubContextOutsideHub/Hubs/VoteHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.SignalR; 6 | 7 | public class VoteHub : Hub 8 | { 9 | private readonly IVoteManager voteManager; 10 | 11 | public VoteHub(IVoteManager voteManager) 12 | { 13 | this.voteManager = voteManager; 14 | } 15 | 16 | public Dictionary GetCurrentVotes() 17 | { 18 | return voteManager.GetCurrentVotes(); 19 | } 20 | } -------------------------------------------------------------------------------- /1_Essentials/13_HubContextOutsideHub/Scaffold.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | all 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/Scaffold.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | all 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /1_Essentials/5_ChoosingTransportType/Scaffold.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | all 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /2_Advanced/15_MultipleHubConnections/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

Change Background

12 |

13 | 14 | 15 |

16 |

17 | 18 | 19 | -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/Models/Info.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Info 5 | { 6 | [JsonPropertyName("seed")] 7 | public string Seed { get; set; } 8 | 9 | [JsonPropertyName("results")] 10 | public int Results { get; set; } 11 | 12 | [JsonPropertyName("page")] 13 | public int Page { get; set; } 14 | 15 | [JsonPropertyName("version")] 16 | public string Version { get; set; } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /2_Advanced/01-1 Client Connection Events/Scaffold.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | all 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /2_Advanced/01-2 Server Connection Events/Scaffold.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | all 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/Models/Info.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Info 5 | { 6 | [JsonPropertyName("seed")] 7 | public string Seed { get; set; } 8 | 9 | [JsonPropertyName("results")] 10 | public int Results { get; set; } 11 | 12 | [JsonPropertyName("page")] 13 | public int Page { get; set; } 14 | 15 | [JsonPropertyName("version")] 16 | public string Version { get; set; } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /1_Essentials/14_HubLifecycle/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Users 8 | 9 | 10 | 11 |

Votes

12 |
13 |

Votes for Pie: 0

14 |

Votes for Bacon: 0

15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/Models/Info.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Info 5 | { 6 | [JsonPropertyName("seed")] 7 | public string Seed { get; set; } 8 | 9 | [JsonPropertyName("results")] 10 | public int Results { get; set; } 11 | 12 | [JsonPropertyName("page")] 13 | public int Page { get; set; } 14 | 15 | [JsonPropertyName("version")] 16 | public string Version { get; set; } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Users 8 | 9 | 10 | 11 |

Users

12 | 13 |
14 | 15 | 16 | 17 |

18 | 19 | 20 | -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Users 8 | 9 | 10 | 11 |

Users

12 | 13 |
14 | 15 | 16 | 17 |

18 | 19 | 20 | -------------------------------------------------------------------------------- /1_Essentials/8_ClientEvents/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Name Concat 8 | 9 | 10 | 11 |

View Count

12 |

13 |

View Count: 0

14 | 15 | 16 |

17 | 18 | 19 | -------------------------------------------------------------------------------- /Presentations/RealTimeRevolution/src/END/wwwroot/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "realtime-revolution-client", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "dependencies": { 7 | "@microsoft/signalr": "^8.0.0", 8 | "tippy.js": "^6.3.7", 9 | "toastify-js": "^1.11.2" 10 | }, 11 | "devDependencies": { 12 | "typescript": "^4.5.2" 13 | }, 14 | "scripts": { 15 | "test": "echo \"Error: no test specified\" && exit 1" 16 | }, 17 | "author": "", 18 | "license": "ISC" 19 | } 20 | -------------------------------------------------------------------------------- /Presentations/RealTimeRevolution/src/START/wwwroot/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "realtime-revolution-client", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "dependencies": { 7 | "@microsoft/signalr": "^8.0.0", 8 | "tippy.js": "^6.3.7", 9 | "toastify-js": "^1.11.2" 10 | }, 11 | "devDependencies": { 12 | "typescript": "^4.5.2" 13 | }, 14 | "scripts": { 15 | "test": "echo \"Error: no test specified\" && exit 1" 16 | }, 17 | "author": "", 18 | "license": "ISC" 19 | } 20 | -------------------------------------------------------------------------------- /1_Essentials/13_HubContextOutsideHub/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Users 8 | 9 | 10 | 11 |

Votes

12 |
13 |

Votes for Pie: 0

14 |

Votes for Bacon: 0

15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Users 8 | 9 | 10 | 11 |

Users

12 | 13 |
14 | 15 | 16 | 17 |

18 | 19 | 20 | -------------------------------------------------------------------------------- /2_Advanced/12_RedisBackplane/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

Change Background

12 |

13 | 14 | 15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /2_Advanced/14_dotnetClient/DotNetClient/DotNetClient.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Exe 4 | net6.0 5 | 6 | 7 | 8 | 9 | all 10 | 11 | 12 | -------------------------------------------------------------------------------- /2_Advanced/14_dotnetClient/Server/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

Change Background

12 |

13 | 14 | 15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /1_Essentials/7_CallingHubMethods/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Name Concat 8 | 9 | 10 | 11 |

Name Concat

12 |

13 | 14 | 15 | 16 | 17 |

18 | 19 | 20 | -------------------------------------------------------------------------------- /2_Advanced/11_AzureSignalRService/11_1-DefaultModeWithASPNETCore/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

Change Background

12 |

13 | 14 | 15 |

16 | 17 | 18 | -------------------------------------------------------------------------------- /2_Advanced/15_MultipleHubConnections/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SignalR Scaffold 8 | 9 | 10 | 11 |

Change Background

12 |

13 | 14 | 15 |

16 |

17 | 18 | 19 | -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Users 8 | 9 | 10 | 11 |

Users

12 | 13 |
14 | 15 | 16 | 17 |

18 | 19 | 20 | -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/Hubs/UserHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.SignalR; 6 | 7 | public class UserHub : Hub 8 | { 9 | private readonly IRandomUserService randomUserService; 10 | 11 | public UserHub(IRandomUserService randomUserService) 12 | { 13 | this.randomUserService = randomUserService; 14 | } 15 | public async Task> GetUsers(int max = 1) 16 | { 17 | var randomUsers = await randomUserService.GetUsers(max); 18 | 19 | return randomUsers; 20 | } 21 | } -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Users 8 | 9 | 10 | 11 |

Users

12 | 13 |
14 | 15 | 16 | 17 |

18 | 19 | 20 | -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/Hubs/UserHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.SignalR; 6 | 7 | public class UserHub : Hub 8 | { 9 | private readonly IRandomUserService randomUserService; 10 | 11 | public UserHub(IRandomUserService randomUserService) 12 | { 13 | this.randomUserService = randomUserService; 14 | } 15 | public async Task> GetUsers(int max = 1) 16 | { 17 | var randomUsers = await randomUserService.GetUsers(max); 18 | 19 | return randomUsers; 20 | } 21 | } -------------------------------------------------------------------------------- /1_Essentials/15_Reconnection/client/CustomRetryPolicy.ts: -------------------------------------------------------------------------------- 1 | import { RetryContext } from "@microsoft/signalr"; 2 | 3 | export default class CustomRetryPolicy implements signalR.IRetryPolicy { 4 | maxRetryAttempts = 0; 5 | 6 | nextRetryDelayInMilliseconds(retryContext: RetryContext): number { 7 | console.info(`Retry :: ${retryContext.retryReason}`); 8 | if (retryContext.previousRetryCount === 10) return null; // stawp! 9 | 10 | var nextRetry = retryContext.previousRetryCount * 1000 || 1000; 11 | console.log(`Retry in ${nextRetry} milliseconds`); 12 | return nextRetry; 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Users 8 | 9 | 10 | 11 |

Users

12 | 13 |
14 | 15 | 16 | 17 |

18 | 19 | 20 | -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/Scaffold.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | 8 | all 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /2_Advanced/12_RedisBackplane/Scaffold.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | 8 | all 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/Hubs/UserHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.SignalR; 6 | 7 | public class UserHub : Hub 8 | { 9 | private readonly IRandomUserService randomUserService; 10 | 11 | public UserHub(IRandomUserService randomUserService) 12 | { 13 | this.randomUserService = randomUserService; 14 | } 15 | public async Task> GetUsers(int max = 1) 16 | { 17 | var randomUsers = await randomUserService.GetUsers(max); 18 | 19 | return randomUsers; 20 | } 21 | } -------------------------------------------------------------------------------- /Demos/todo-application/realtimetodo.client/src/router/index.ts: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter, { RouteConfig } from 'vue-router' 3 | import Home from '../views/Home.vue' 4 | import List from '../views/List.vue'; 5 | 6 | Vue.use(VueRouter) 7 | 8 | const routes: Array = [ 9 | { 10 | path: '/', 11 | name: 'Home', 12 | component: Home 13 | }, 14 | { 15 | path: '/list/:listId', 16 | name: 'list', 17 | component: List 18 | } 19 | ] 20 | 21 | const router = new VueRouter({ 22 | mode: 'history', 23 | base: process.env.BASE_URL, 24 | routes 25 | }) 26 | 27 | export default router 28 | -------------------------------------------------------------------------------- /Demos/todo-application/RealTimeTodo.Web/RealTimeTodo.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | 8 | all 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /1_Essentials/14_HubLifecycle/Services/VoteManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using Microsoft.AspNetCore.SignalR; 4 | 5 | public class VoteManager : IVoteManager 6 | { 7 | private static Dictionary votes; 8 | static VoteManager() 9 | { 10 | votes = new Dictionary(); 11 | votes.Add("pie", 0); 12 | votes.Add("bacon", 0); 13 | } 14 | 15 | public async Task CastVote(string voteFor) 16 | { 17 | votes[voteFor]++; 18 | } 19 | 20 | public Dictionary GetCurrentVotes() 21 | { 22 | return votes; 23 | } 24 | } -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/Pages/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | using Microsoft.Extensions.Logging; 8 | 9 | namespace _08_1_Authorization.Pages 10 | { 11 | public class IndexModel : PageModel 12 | { 13 | private readonly ILogger _logger; 14 | 15 | public IndexModel(ILogger logger) 16 | { 17 | _logger = logger; 18 | } 19 | 20 | public void OnGet() 21 | { 22 | 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/Pages/Privacy.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | using Microsoft.Extensions.Logging; 8 | 9 | namespace _08_1_Authorization.Pages 10 | { 11 | public class PrivacyModel : PageModel 12 | { 13 | private readonly ILogger _logger; 14 | 15 | public PrivacyModel(ILogger logger) 16 | { 17 | _logger = logger; 18 | } 19 | 20 | public void OnGet() 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /2_Advanced/01-2 Server Connection Events/client/index.ts: -------------------------------------------------------------------------------- 1 | import * as signalR from "@microsoft/signalr"; 2 | 3 | var counter = document.getElementById("viewCounter"); 4 | 5 | // create connection 6 | let connection = new signalR.HubConnectionBuilder() 7 | .withUrl("/hub/view") 8 | .build(); 9 | 10 | // on view update message from client 11 | connection.on("viewCountUpdate", (value: number) => { 12 | counter.innerText = value.toString(); 13 | }); 14 | 15 | // start the connection 16 | function startSuccess(){ 17 | console.log("Connected."); 18 | } 19 | function startFail(){ 20 | console.log("Connection failed."); 21 | } 22 | 23 | connection.start().then(startSuccess, startFail); -------------------------------------------------------------------------------- /2_Advanced/13_HostedServices/client/index.ts: -------------------------------------------------------------------------------- 1 | import * as signalR from "@microsoft/signalr"; 2 | 3 | var currentTime = document.getElementById("currentTime"); 4 | 5 | // create connection 6 | let connection = new signalR.HubConnectionBuilder() 7 | .withUrl("/hub/time") 8 | .build(); 9 | 10 | // on view update message from client 11 | connection.on("updateCurrentTime", (value: number) => { 12 | currentTime.innerText = value.toString(); 13 | }); 14 | 15 | // start the connection 16 | function startSuccess(){ 17 | console.log("Connected."); 18 | } 19 | function startFail(){ 20 | console.log("Connection failed."); 21 | } 22 | 23 | connection.start().then(startSuccess, startFail); -------------------------------------------------------------------------------- /Presentations/RealTimeRevolution/src/START/wwwroot/index.js: -------------------------------------------------------------------------------- 1 | var textBox = document.getElementById("txtBox"); 2 | var checkBox = document.getElementById("checkBox"); 3 | var btnStart = document.getElementById("btnStart"); 4 | var btnEnd = document.getElementById("btnEnd"); 5 | 6 | /* signalr events */ 7 | 8 | /* local events */ 9 | textBox.addEventListener("change", (ev) => { 10 | var target = ev.target; 11 | }); 12 | 13 | checkBox.addEventListener("change", (ev) => { 14 | var target = ev.target; 15 | }); 16 | 17 | 18 | /* new user events */ 19 | 20 | btnStart.addEventListener("click", (ev) => { 21 | }); 22 | 23 | btnEnd.addEventListener("click", (ev) => { 24 | }); -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /1_Essentials/11_Groups/client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Groups 8 | 9 | 10 | 11 |

Groups

12 | 13 | 14 | 15 |
16 |
17 | 18 | 19 | 20 |

21 | 22 | 23 | -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/Client/Template/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /Presentations/RealTimeRevolution/src/END/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "requires": true, 3 | "lockfileVersion": 1, 4 | "dependencies": { 5 | "@types/node": { 6 | "version": "16.0.0", 7 | "resolved": "https://registry.npmjs.org/@types/node/-/node-16.0.0.tgz", 8 | "integrity": "sha512-TmCW5HoZ2o2/z2EYi109jLqIaPIi9y/lc2LmDCWzuCi35bcaQ+OtUh6nwBiFK7SOu25FAU5+YKdqFZUwtqGSdg==", 9 | "dev": true 10 | }, 11 | "typescript": { 12 | "version": "4.3.5", 13 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz", 14 | "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==" 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Presentations/RealTimeRevolution/src/START/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "requires": true, 3 | "lockfileVersion": 1, 4 | "dependencies": { 5 | "@types/node": { 6 | "version": "16.0.0", 7 | "resolved": "https://registry.npmjs.org/@types/node/-/node-16.0.0.tgz", 8 | "integrity": "sha512-TmCW5HoZ2o2/z2EYi109jLqIaPIi9y/lc2LmDCWzuCi35bcaQ+OtUh6nwBiFK7SOu25FAU5+YKdqFZUwtqGSdg==", 9 | "dev": true 10 | }, 11 | "typescript": { 12 | "version": "4.3.5", 13 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz", 14 | "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==" 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /2_Advanced/14_dotnetClient/Server/Scaffold.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | 8 | 9 | all 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /2_Advanced/15_MultipleHubConnections/Scaffold.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | 8 | 9 | all 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Presentations/RealTimeRevolution/src/END/Hubs/SyncHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Threading.Tasks; 3 | using Microsoft.AspNetCore.SignalR; 4 | 5 | public class SyncHub : Hub 6 | { 7 | public async Task SyncTextBox(string text) 8 | { 9 | await Clients.Others.SendAsync("syncTextBox", text); 10 | } 11 | 12 | public async Task SyncCheckbox(bool checkbox) 13 | { 14 | await Clients.Others.SendAsync("syncCheckbox", checkbox); 15 | } 16 | 17 | public async Task StartNotify(){ 18 | await Groups.AddToGroupAsync(Context.ConnectionId, "notify-me"); 19 | } 20 | public async Task EndNotify() { 21 | await Groups.RemoveFromGroupAsync(Context.ConnectionId, "notify-me"); 22 | } 23 | } -------------------------------------------------------------------------------- /Demos/todo-application/realtimetodo.client/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /2_Advanced/11_AzureSignalRService/11_1-DefaultModeWithASPNETCore/Scaffold.Web.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net6.0 4 | 5 | 6 | 7 | 8 | 9 | all 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /2_Advanced/01-2 Server Connection Events/Hubs/ViewHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.SignalR; 5 | 6 | public class ViewHub : Hub 7 | { 8 | public static int ViewCount { get; set; } = 0; 9 | 10 | public async override Task OnConnectedAsync() 11 | { 12 | ViewCount++; 13 | 14 | await this.Clients.All.SendAsync("viewCountUpdate", ViewCount); 15 | 16 | await base.OnConnectedAsync(); 17 | } 18 | public async override Task OnDisconnectedAsync(Exception exception) 19 | { 20 | ViewCount--; 21 | 22 | await this.Clients.All.SendAsync("viewCountUpdate", ViewCount); 23 | 24 | await base.OnDisconnectedAsync(exception); 25 | } 26 | } -------------------------------------------------------------------------------- /1_Essentials/14_HubLifecycle/Hubs/VoteHub.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.SignalR; 6 | using Microsoft.Extensions.Logging; 7 | 8 | public class VoteHub : Hub 9 | { 10 | private readonly IVoteManager voteManager; 11 | private readonly ILogger logger; 12 | 13 | public VoteHub(IVoteManager voteManager, ILogger logger) 14 | { 15 | this.voteManager = voteManager; 16 | this.logger = logger; 17 | 18 | logger.LogDebug($"VoteHub created. {DateTime.UtcNow.ToLongTimeString()}"); 19 | } 20 | 21 | public Dictionary GetCurrentVotes() 22 | { 23 | return voteManager.GetCurrentVotes(); 24 | } 25 | } -------------------------------------------------------------------------------- /1_Essentials/11_Groups/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Groups 8 | 9 | 10 | 11 |

Groups

12 | 13 | 14 | 15 |
16 |
17 | 18 | 19 | 20 |

21 | 22 | 23 | -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/Models/Login.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Login 5 | { 6 | [JsonPropertyName("uuid")] 7 | public string Uuid { get; set; } 8 | 9 | [JsonPropertyName("username")] 10 | public string Username { get; set; } 11 | 12 | [JsonPropertyName("password")] 13 | public string Password { get; set; } 14 | 15 | [JsonPropertyName("salt")] 16 | public string Salt { get; set; } 17 | 18 | [JsonPropertyName("md5")] 19 | public string Md5 { get; set; } 20 | 21 | [JsonPropertyName("sha1")] 22 | public string Sha1 { get; set; } 23 | 24 | [JsonPropertyName("sha256")] 25 | public string Sha256 { get; set; } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/Models/Login.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Login 5 | { 6 | [JsonPropertyName("uuid")] 7 | public string Uuid { get; set; } 8 | 9 | [JsonPropertyName("username")] 10 | public string Username { get; set; } 11 | 12 | [JsonPropertyName("password")] 13 | public string Password { get; set; } 14 | 15 | [JsonPropertyName("salt")] 16 | public string Salt { get; set; } 17 | 18 | [JsonPropertyName("md5")] 19 | public string Md5 { get; set; } 20 | 21 | [JsonPropertyName("sha1")] 22 | public string Sha1 { get; set; } 23 | 24 | [JsonPropertyName("sha256")] 25 | public string Sha256 { get; set; } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/Models/Location.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Location 5 | { 6 | [JsonPropertyName("street")] 7 | public Street Street { get; set; } 8 | 9 | [JsonPropertyName("city")] 10 | public string City { get; set; } 11 | 12 | [JsonPropertyName("state")] 13 | public string State { get; set; } 14 | 15 | [JsonPropertyName("postcode")] 16 | [JsonConverter(typeof(LongToStringJsonConverter))] 17 | public string Postcode { get; set; } 18 | 19 | [JsonPropertyName("coordinates")] 20 | public Coordinates Coordinates { get; set; } 21 | 22 | [JsonPropertyName("timezone")] 23 | public Timezone Timezone { get; set; } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /Upgrade.ps1: -------------------------------------------------------------------------------- 1 | # Get-ChildItem . -recurse -include *.csproj | upgrade-assistant --skip-backup --non-interactive upgrade $_.Name 2 | 3 | Write-Output "Iterating over all projects in folder" 4 | foreach ( $file in Get-ChildItem -recurse -include *.csproj) 5 | { 6 | Write-Output "Upgrading project $file" 7 | upgrade-assistant upgrade --skip-backup --non-interactive $file 8 | } 9 | 10 | Write-Output "Remove .clef files" 11 | Get-ChildItem . -recurse -include *.clef | remove-item 12 | 13 | Write-Output "Iterating over NPM packages" 14 | foreach ( $file in Get-ChildItem -recurse -include package.json | Where-Object {!($_.Directory -like "*node_modules*")} ) 15 | { 16 | Write-Output $file 17 | Set-Location $file.Directory -PassThru 18 | ncu -u 19 | npm install 20 | } 21 | -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/Models/Location.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Location 5 | { 6 | [JsonPropertyName("street")] 7 | public Street Street { get; set; } 8 | 9 | [JsonPropertyName("city")] 10 | public string City { get; set; } 11 | 12 | [JsonPropertyName("state")] 13 | public string State { get; set; } 14 | 15 | [JsonPropertyName("postcode")] 16 | [JsonConverter(typeof(LongToStringJsonConverter))] 17 | public string Postcode { get; set; } 18 | 19 | [JsonPropertyName("coordinates")] 20 | public Coordinates Coordinates { get; set; } 21 | 22 | [JsonPropertyName("timezone")] 23 | public Timezone Timezone { get; set; } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/Models/Login.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Login 5 | { 6 | [JsonPropertyName("uuid")] 7 | public string Uuid { get; set; } 8 | 9 | [JsonPropertyName("username")] 10 | public string Username { get; set; } 11 | 12 | [JsonPropertyName("password")] 13 | public string Password { get; set; } 14 | 15 | [JsonPropertyName("salt")] 16 | public string Salt { get; set; } 17 | 18 | [JsonPropertyName("md5")] 19 | public string Md5 { get; set; } 20 | 21 | [JsonPropertyName("sha1")] 22 | public string Sha1 { get; set; } 23 | 24 | [JsonPropertyName("sha256")] 25 | public string Sha256 { get; set; } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/Models/Location.cs: -------------------------------------------------------------------------------- 1 | // Root myDeserializedClass = JsonSerializer.Deserialize(myJsonResponse); 2 | using System.Text.Json.Serialization; 3 | 4 | public class Location 5 | { 6 | [JsonPropertyName("street")] 7 | public Street Street { get; set; } 8 | 9 | [JsonPropertyName("city")] 10 | public string City { get; set; } 11 | 12 | [JsonPropertyName("state")] 13 | public string State { get; set; } 14 | 15 | [JsonPropertyName("postcode")] 16 | [JsonConverter(typeof(LongToStringJsonConverter))] 17 | public string Postcode { get; set; } 18 | 19 | [JsonPropertyName("coordinates")] 20 | public Coordinates Coordinates { get; set; } 21 | 22 | [JsonPropertyName("timezone")] 23 | public Timezone Timezone { get; set; } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /1_Essentials/1_BasicClientServer/client/index.ts: -------------------------------------------------------------------------------- 1 | import * as signalR from "@microsoft/signalr"; 2 | 3 | var counter = document.getElementById("viewCounter"); 4 | 5 | // create connection 6 | let connection = new signalR.HubConnectionBuilder() 7 | .withUrl("/hub/view") 8 | .build(); 9 | 10 | // on view update message from client 11 | connection.on("viewCountUpdate", (value: number) => { 12 | counter.innerText = value.toString(); 13 | }); 14 | 15 | // notify server we're watching 16 | function notify(){ 17 | connection.send("notifyWatching"); 18 | } 19 | 20 | // start the connection 21 | function startSuccess(){ 22 | console.log("Connected."); 23 | notify(); 24 | } 25 | function startFail(){ 26 | console.log("Connection failed."); 27 | } 28 | 29 | connection.start().then(startSuccess, startFail); -------------------------------------------------------------------------------- /2_Advanced/03_StronglyTypedHubs/client/index.ts: -------------------------------------------------------------------------------- 1 | import * as signalR from "@microsoft/signalr"; 2 | 3 | var counter = document.getElementById("viewCounter"); 4 | 5 | // create connection 6 | let connection = new signalR.HubConnectionBuilder() 7 | .withUrl("/hub/view") 8 | .build(); 9 | 10 | // on view update message from client 11 | connection.on("viewCountUpdate", (value: number) => { 12 | counter.innerText = value.toString(); 13 | }); 14 | 15 | // notify server we're watching 16 | function notify(){ 17 | connection.send("notifyWatching"); 18 | } 19 | 20 | // start the connection 21 | function startSuccess(){ 22 | console.log("Connected."); 23 | notify(); 24 | } 25 | function startFail(){ 26 | console.log("Connection failed."); 27 | } 28 | 29 | connection.start().then(startSuccess, startFail); -------------------------------------------------------------------------------- /1_Essentials/11_Groups/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Scaffold.Web 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /1_Essentials/8_ClientEvents/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Scaffold.Web 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Scaffold.Web 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Scaffold.Web 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /1_Essentials/15_Reconnection/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Scaffold.Web 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /1_Essentials/1_BasicClientServer/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Scaffold.Web 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /1_Essentials/7_CallingHubMethods/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Scaffold.Web 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /2_Advanced/03_StronglyTypedHubs/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Scaffold.Web 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /2_Advanced/12_RedisBackplane/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Scaffold.Web 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /2_Advanced/13_HostedServices/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Scaffold.Web 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Presentations/RealTimeRevolution/src/END/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace src 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /1_Essentials/13_HubContextOutsideHub/Controllers/VoteController.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Threading.Tasks; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Microsoft.AspNetCore.SignalR; 5 | 6 | public class VoteController : ControllerBase 7 | { 8 | private readonly IVoteManager voteManager; 9 | 10 | public VoteController(IVoteManager voteManager) 11 | { 12 | this.voteManager = voteManager; 13 | } 14 | [HttpPost("/vote/pie")] 15 | public async Task VotePie() 16 | { 17 | // save vote 18 | await voteManager.CastVote("pie"); 19 | 20 | return Ok(); 21 | } 22 | 23 | [HttpPost("/vote/bacon")] 24 | public async Task VoteBacon() 25 | { 26 | // save vote 27 | await voteManager.CastVote("bacon"); 28 | 29 | return Ok(); 30 | } 31 | } -------------------------------------------------------------------------------- /1_Essentials/13_HubContextOutsideHub/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Scaffold.Web 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Scaffold.Web 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /1_Essentials/5_ChoosingTransportType/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Scaffold.Web 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace _08_1_Authorization 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /2_Advanced/14_dotnetClient/Server/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Scaffold.Web 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /2_Advanced/15_MultipleHubConnections/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Scaffold.Web 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Presentations/RealTimeRevolution/src/START/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace src 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /1_Essentials/11_Groups/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5052", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Scaffold.Web": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /1_Essentials/2_Logging/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5052", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Scaffold.Web": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2_Advanced/01-1 Client Connection Events/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Scaffold.Web 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /2_Advanced/01-2 Server Connection Events/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Scaffold.Web 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /1_Essentials/11_Groups/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scaffold.Web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "build": "webpack --mode=development --watch", 9 | "release": "webpack --mode=production", 10 | "publish": "npm run release && dotnet publish -c Release" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "clean-webpack-plugin": "4.0.0", 17 | "css-loader": "6.5.1", 18 | "html-webpack-plugin": "5.5.0", 19 | "mini-css-extract-plugin": "2.4.5", 20 | "ts-loader": "9.2.6", 21 | "typescript": "4.5.2", 22 | "webpack": "5.64.3", 23 | "webpack-cli": "4.9.1" 24 | }, 25 | "dependencies": { 26 | "@microsoft/signalr": "^8.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5052", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Scaffold.Web": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /1_Essentials/14_HubLifecycle/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5052", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Scaffold.Web": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /1_Essentials/15_Reconnection/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5052", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Scaffold.Web": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /1_Essentials/2_Logging/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scaffold.Web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "build": "webpack --mode=development --watch", 9 | "release": "webpack --mode=production", 10 | "publish": "npm run release && dotnet publish -c Release" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "clean-webpack-plugin": "4.0.0", 17 | "css-loader": "6.5.1", 18 | "html-webpack-plugin": "5.5.0", 19 | "mini-css-extract-plugin": "2.4.5", 20 | "ts-loader": "9.2.6", 21 | "typescript": "4.5.2", 22 | "webpack": "5.64.3", 23 | "webpack-cli": "4.9.1" 24 | }, 25 | "dependencies": { 26 | "@microsoft/signalr": "^8.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /1_Essentials/8_ClientEvents/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5052", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Scaffold.Web": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5052", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Scaffold.Web": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2_Advanced/12_RedisBackplane/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5052", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Scaffold.Web": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2_Advanced/13_HostedServices/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5052", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Scaffold.Web": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scaffold.Web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "build": "webpack --mode=development --watch", 9 | "release": "webpack --mode=production", 10 | "publish": "npm run release && dotnet publish -c Release" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "clean-webpack-plugin": "4.0.0", 17 | "css-loader": "6.5.1", 18 | "html-webpack-plugin": "5.5.0", 19 | "mini-css-extract-plugin": "2.4.5", 20 | "ts-loader": "9.2.6", 21 | "typescript": "4.5.2", 22 | "webpack": "5.64.3", 23 | "webpack-cli": "4.9.1" 24 | }, 25 | "dependencies": { 26 | "@microsoft/signalr": "^8.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /1_Essentials/14_HubLifecycle/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scaffold.Web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "build": "webpack --mode=development --watch", 9 | "release": "webpack --mode=production", 10 | "publish": "npm run release && dotnet publish -c Release" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "clean-webpack-plugin": "4.0.0", 17 | "css-loader": "6.5.1", 18 | "html-webpack-plugin": "5.5.0", 19 | "mini-css-extract-plugin": "2.4.5", 20 | "ts-loader": "9.2.6", 21 | "typescript": "4.5.2", 22 | "webpack": "5.64.3", 23 | "webpack-cli": "4.9.1" 24 | }, 25 | "dependencies": { 26 | "@microsoft/signalr": "^8.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /1_Essentials/15_Reconnection/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scaffold.Web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "build": "webpack --mode=development --watch", 9 | "release": "webpack --mode=production", 10 | "publish": "npm run release && dotnet publish -c Release" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "clean-webpack-plugin": "4.0.0", 17 | "css-loader": "6.5.1", 18 | "html-webpack-plugin": "5.5.0", 19 | "mini-css-extract-plugin": "2.4.5", 20 | "ts-loader": "9.2.6", 21 | "typescript": "4.5.2", 22 | "webpack": "5.64.3", 23 | "webpack-cli": "4.9.1" 24 | }, 25 | "dependencies": { 26 | "@microsoft/signalr": "^8.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /1_Essentials/1_BasicClientServer/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5052", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Scaffold.Web": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /1_Essentials/7_CallingHubMethods/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5052", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Scaffold.Web": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /1_Essentials/8_ClientEvents/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scaffold.Web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "build": "webpack --mode=development --watch", 9 | "release": "webpack --mode=production", 10 | "publish": "npm run release && dotnet publish -c Release" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "clean-webpack-plugin": "4.0.0", 17 | "css-loader": "6.5.1", 18 | "html-webpack-plugin": "5.5.0", 19 | "mini-css-extract-plugin": "2.4.5", 20 | "ts-loader": "9.2.6", 21 | "typescript": "4.5.2", 22 | "webpack": "5.64.3", 23 | "webpack-cli": "4.9.1" 24 | }, 25 | "dependencies": { 26 | "@microsoft/signalr": "^8.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2_Advanced/03_StronglyTypedHubs/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5052", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Scaffold.Web": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2_Advanced/12_RedisBackplane/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scaffold.Web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "build": "webpack --mode=development --watch", 9 | "release": "webpack --mode=production", 10 | "publish": "npm run release && dotnet publish -c Release" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "clean-webpack-plugin": "4.0.0", 17 | "css-loader": "6.5.1", 18 | "html-webpack-plugin": "5.5.0", 19 | "mini-css-extract-plugin": "2.4.5", 20 | "ts-loader": "9.2.6", 21 | "typescript": "4.5.2", 22 | "webpack": "5.64.3", 23 | "webpack-cli": "4.9.1" 24 | }, 25 | "dependencies": { 26 | "@microsoft/signalr": "^8.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2_Advanced/13_HostedServices/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scaffold.Web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "build": "webpack --mode=development --watch", 9 | "release": "webpack --mode=production", 10 | "publish": "npm run release && dotnet publish -c Release" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "clean-webpack-plugin": "4.0.0", 17 | "css-loader": "6.5.1", 18 | "html-webpack-plugin": "5.5.0", 19 | "mini-css-extract-plugin": "2.4.5", 20 | "ts-loader": "9.2.6", 21 | "typescript": "4.5.2", 22 | "webpack": "5.64.3", 23 | "webpack-cli": "4.9.1" 24 | }, 25 | "dependencies": { 26 | "@microsoft/signalr": "^8.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2_Advanced/14_dotnetClient/Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5052", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Scaffold.Web": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Presentations/RealTimeRevolution/src/END/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:22186", 7 | "sslPort": 44327 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "src": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /1_Essentials/13_HubContextOutsideHub/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5052", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Scaffold.Web": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5052", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Scaffold.Web": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /1_Essentials/1_BasicClientServer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scaffold.Web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "build": "webpack --mode=development --watch", 9 | "release": "webpack --mode=production", 10 | "publish": "npm run release && dotnet publish -c Release" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "clean-webpack-plugin": "4.0.0", 17 | "css-loader": "6.5.1", 18 | "html-webpack-plugin": "5.5.0", 19 | "mini-css-extract-plugin": "2.4.5", 20 | "ts-loader": "9.2.6", 21 | "typescript": "4.5.2", 22 | "webpack": "5.64.3", 23 | "webpack-cli": "4.9.1" 24 | }, 25 | "dependencies": { 26 | "@microsoft/signalr": "^8.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /1_Essentials/5_ChoosingTransportType/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5052", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Scaffold.Web": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /1_Essentials/7_CallingHubMethods/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scaffold.Web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "build": "webpack --mode=development --watch", 9 | "release": "webpack --mode=production", 10 | "publish": "npm run release && dotnet publish -c Release" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "clean-webpack-plugin": "4.0.0", 17 | "css-loader": "6.5.1", 18 | "html-webpack-plugin": "5.5.0", 19 | "mini-css-extract-plugin": "2.4.5", 20 | "ts-loader": "9.2.6", 21 | "typescript": "4.5.2", 22 | "webpack": "5.64.3", 23 | "webpack-cli": "4.9.1" 24 | }, 25 | "dependencies": { 26 | "@microsoft/signalr": "^8.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2_Advanced/03_StronglyTypedHubs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scaffold.Web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "build": "webpack --mode=development --watch", 9 | "release": "webpack --mode=production", 10 | "publish": "npm run release && dotnet publish -c Release" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "clean-webpack-plugin": "4.0.0", 17 | "css-loader": "6.5.1", 18 | "html-webpack-plugin": "5.5.0", 19 | "mini-css-extract-plugin": "2.4.5", 20 | "ts-loader": "9.2.6", 21 | "typescript": "4.5.2", 22 | "webpack": "5.64.3", 23 | "webpack-cli": "4.9.1" 24 | }, 25 | "dependencies": { 26 | "@microsoft/signalr": "^8.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:56783", 7 | "sslPort": 44378 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "_08_1_Authorization": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2_Advanced/14_dotnetClient/Server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scaffold.Web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "build": "webpack --mode=development --watch", 9 | "release": "webpack --mode=production", 10 | "publish": "npm run release && dotnet publish -c Release" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "clean-webpack-plugin": "4.0.0", 17 | "css-loader": "6.5.1", 18 | "html-webpack-plugin": "5.5.0", 19 | "mini-css-extract-plugin": "2.4.5", 20 | "ts-loader": "9.2.6", 21 | "typescript": "4.5.2", 22 | "webpack": "5.64.3", 23 | "webpack-cli": "4.9.1" 24 | }, 25 | "dependencies": { 26 | "@microsoft/signalr": "^8.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2_Advanced/15_MultipleHubConnections/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5052", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Scaffold.Web": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Presentations/RealTimeRevolution/src/START/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:22186", 7 | "sslPort": 44327 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "src": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /1_Essentials/13_HubContextOutsideHub/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scaffold.Web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "build": "webpack --mode=development --watch", 9 | "release": "webpack --mode=production", 10 | "publish": "npm run release && dotnet publish -c Release" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "clean-webpack-plugin": "4.0.0", 17 | "css-loader": "6.5.1", 18 | "html-webpack-plugin": "5.5.0", 19 | "mini-css-extract-plugin": "2.4.5", 20 | "ts-loader": "9.2.6", 21 | "typescript": "4.5.2", 22 | "webpack": "5.64.3", 23 | "webpack-cli": "4.9.1" 24 | }, 25 | "dependencies": { 26 | "@microsoft/signalr": "^8.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scaffold.Web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "build": "webpack --mode=development --watch", 9 | "release": "webpack --mode=production", 10 | "publish": "npm run release && dotnet publish -c Release" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "clean-webpack-plugin": "4.0.0", 17 | "css-loader": "6.5.1", 18 | "html-webpack-plugin": "5.5.0", 19 | "mini-css-extract-plugin": "2.4.5", 20 | "ts-loader": "9.2.6", 21 | "typescript": "4.5.2", 22 | "webpack": "5.64.3", 23 | "webpack-cli": "4.9.1" 24 | }, 25 | "dependencies": { 26 | "@microsoft/signalr": "^8.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /1_Essentials/5_ChoosingTransportType/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scaffold.Web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "build": "webpack --mode=development --watch", 9 | "release": "webpack --mode=production", 10 | "publish": "npm run release && dotnet publish -c Release" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "clean-webpack-plugin": "4.0.0", 17 | "css-loader": "6.5.1", 18 | "html-webpack-plugin": "5.5.0", 19 | "mini-css-extract-plugin": "2.4.5", 20 | "ts-loader": "9.2.6", 21 | "typescript": "4.5.2", 22 | "webpack": "5.64.3", 23 | "webpack-cli": "4.9.1" 24 | }, 25 | "dependencies": { 26 | "@microsoft/signalr": "^8.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2_Advanced/01-1 Client Connection Events/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5052", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Scaffold.Web": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2_Advanced/01-2 Server Connection Events/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5052", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Scaffold.Web": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2_Advanced/15_MultipleHubConnections/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scaffold.Web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "build": "webpack --mode=development --watch", 9 | "release": "webpack --mode=production", 10 | "publish": "npm run release && dotnet publish -c Release" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "clean-webpack-plugin": "4.0.0", 17 | "css-loader": "6.5.1", 18 | "html-webpack-plugin": "5.5.0", 19 | "mini-css-extract-plugin": "2.4.5", 20 | "ts-loader": "9.2.6", 21 | "typescript": "4.5.2", 22 | "webpack": "5.64.3", 23 | "webpack-cli": "4.9.1" 24 | }, 25 | "dependencies": { 26 | "@microsoft/signalr": "^8.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2_Advanced/01-1 Client Connection Events/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scaffold.Web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "build": "webpack --mode=development --watch", 9 | "release": "webpack --mode=production", 10 | "publish": "npm run release && dotnet publish -c Release" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "clean-webpack-plugin": "4.0.0", 17 | "css-loader": "6.5.1", 18 | "html-webpack-plugin": "5.5.0", 19 | "mini-css-extract-plugin": "2.4.5", 20 | "ts-loader": "9.2.6", 21 | "typescript": "4.5.2", 22 | "webpack": "5.64.3", 23 | "webpack-cli": "4.9.1" 24 | }, 25 | "dependencies": { 26 | "@microsoft/signalr": "^8.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2_Advanced/01-2 Server Connection Events/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scaffold.Web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "build": "webpack --mode=development --watch", 9 | "release": "webpack --mode=production", 10 | "publish": "npm run release && dotnet publish -c Release" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "clean-webpack-plugin": "4.0.0", 17 | "css-loader": "6.5.1", 18 | "html-webpack-plugin": "5.5.0", 19 | "mini-css-extract-plugin": "2.4.5", 20 | "ts-loader": "9.2.6", 21 | "typescript": "4.5.2", 22 | "webpack": "5.64.3", 23 | "webpack-cli": "4.9.1" 24 | }, 25 | "dependencies": { 26 | "@microsoft/signalr": "^8.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2_Advanced/11_AzureSignalRService/11_1-DefaultModeWithASPNETCore/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Scaffold.Web 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Demos/todo-application/RealTimeTodo.Web/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:26564", 7 | "sslPort": 44352 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "RealTimeTodo.Web": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2_Advanced/11_AzureSignalRService/11_1-DefaultModeWithASPNETCore/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5052", 7 | "sslPort": 44319 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Scaffold.Web": { 19 | "commandName": "Project", 20 | "dotnetRunMessages": "true", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2_Advanced/11_AzureSignalRService/11_1-DefaultModeWithASPNETCore/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scaffold.Web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "build": "webpack --mode=development --watch", 9 | "release": "webpack --mode=production", 10 | "publish": "npm run release && dotnet publish -c Release" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "clean-webpack-plugin": "4.0.0", 17 | "css-loader": "6.5.1", 18 | "html-webpack-plugin": "5.5.0", 19 | "mini-css-extract-plugin": "2.4.5", 20 | "ts-loader": "9.2.6", 21 | "typescript": "4.5.2", 22 | "webpack": "5.64.3", 23 | "webpack-cli": "4.9.1" 24 | }, 25 | "dependencies": { 26 | "@microsoft/signalr": "^8.0.0" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scaffold.Web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "build": "webpack --mode=development --watch", 9 | "release": "webpack --mode=production", 10 | "publish": "npm run release && dotnet publish -c Release" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "clean-webpack-plugin": "4.0.0", 17 | "css-loader": "6.5.1", 18 | "html-webpack-plugin": "5.5.0", 19 | "mini-css-extract-plugin": "2.4.5", 20 | "ts-loader": "9.2.6", 21 | "typescript": "4.5.2", 22 | "webpack": "5.64.3", 23 | "webpack-cli": "4.9.1" 24 | }, 25 | "dependencies": { 26 | "@microsoft/signalr": "^8.0.0", 27 | "@microsoft/signalr-protocol-msgpack": "^8.0.0" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /1_Essentials/14_HubLifecycle/client/index.ts: -------------------------------------------------------------------------------- 1 | import * as signalR from "@microsoft/signalr"; 2 | 3 | let pieVotes = document.getElementById("pieVotes"); 4 | let baconVotes = document.getElementById("baconVotes"); 5 | 6 | // create connection 7 | let connection = new signalR.HubConnectionBuilder() 8 | .withUrl("/hub/vote") 9 | .build(); 10 | 11 | // client events 12 | connection.on("updateVotes", (votes) => { 13 | pieVotes.innerText = votes.pie; 14 | baconVotes.innerText = votes.bacon; 15 | }); 16 | 17 | // start the connection 18 | function startSuccess() { 19 | console.log("Connected."); 20 | connection.invoke("GetCurrentVotes").then((votes) => { 21 | pieVotes.innerText = votes.pie; 22 | baconVotes.innerText = votes.bacon; 23 | }); 24 | } 25 | function startFail() { 26 | console.log("Connection failed."); 27 | } 28 | 29 | connection.start().then(startSuccess, startFail); -------------------------------------------------------------------------------- /1_Essentials/13_HubContextOutsideHub/client/index.ts: -------------------------------------------------------------------------------- 1 | import * as signalR from "@microsoft/signalr"; 2 | 3 | let pieVotes = document.getElementById("pieVotes"); 4 | let baconVotes = document.getElementById("baconVotes"); 5 | 6 | // create connection 7 | let connection = new signalR.HubConnectionBuilder() 8 | .withUrl("/hub/vote") 9 | .build(); 10 | 11 | // client events 12 | connection.on("updateVotes", (votes) => { 13 | pieVotes.innerText = votes.pie; 14 | baconVotes.innerText = votes.bacon; 15 | }); 16 | 17 | // start the connection 18 | function startSuccess() { 19 | console.log("Connected."); 20 | connection.invoke("GetCurrentVotes").then((votes) => { 21 | pieVotes.innerText = votes.pie; 22 | baconVotes.innerText = votes.bacon; 23 | }); 24 | } 25 | function startFail() { 26 | console.log("Connection failed."); 27 | } 28 | 29 | connection.start().then(startSuccess, startFail); -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/Services/RandomUserService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Net.Http; 4 | using System.Text.Json; 5 | using System.Threading.Tasks; 6 | 7 | public class RandomUserService : IRandomUserService 8 | { 9 | const string URL = "https://randomuser.me/api/"; 10 | private readonly HttpClient httpClient; 11 | 12 | public RandomUserService(HttpClient httpClient) 13 | { 14 | this.httpClient = httpClient; 15 | } 16 | 17 | public async Task> GetUsers(int max = 1) 18 | { 19 | //?results=5000 MAX 20 | if (max > 5000) max = 5000; 21 | 22 | var jsonResult = await httpClient.GetStringAsync($"{URL}?results={max}"); 23 | RandomUserRoot randomUserRoot = 24 | JsonSerializer.Deserialize(jsonResult); 25 | 26 | return randomUserRoot.Results; 27 | } 28 | } -------------------------------------------------------------------------------- /1_Essentials/7_CallingHubMethods/client/index.ts: -------------------------------------------------------------------------------- 1 | import * as signalR from "@microsoft/signalr"; 2 | 3 | 4 | let btn = document.getElementById("btnGetFullName"); 5 | 6 | // create connection 7 | let connection = new signalR.HubConnectionBuilder() 8 | .withUrl("/hub/stringtools") 9 | .build(); 10 | 11 | btn.addEventListener("click", function (evt) { 12 | var firstName = (document.getElementById("inputFirstName") as HTMLInputElement).value; 13 | var lastName = (document.getElementById("inputLastName") as HTMLInputElement).value; 14 | 15 | connection 16 | .invoke("getFullName", firstName, lastName) 17 | .then((name: string) => { alert(name); }); 18 | }); 19 | 20 | // start the connection 21 | function startSuccess() { 22 | console.log("Connected."); 23 | } 24 | function startFail() { 25 | console.log("Connection failed."); 26 | } 27 | 28 | connection.start().then(startSuccess, startFail); -------------------------------------------------------------------------------- /2_Advanced/02_MessagePack/Services/RandomUserService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Net.Http; 4 | using System.Text.Json; 5 | using System.Threading.Tasks; 6 | 7 | public class RandomUserService : IRandomUserService 8 | { 9 | const string URL = "https://randomuser.me/api/"; 10 | private readonly HttpClient httpClient; 11 | 12 | public RandomUserService(HttpClient httpClient) 13 | { 14 | this.httpClient = httpClient; 15 | } 16 | 17 | public async Task> GetUsers(int max = 1) 18 | { 19 | //?results=5000 MAX 20 | if (max > 5000) max = 5000; 21 | 22 | var jsonResult = await httpClient.GetStringAsync($"{URL}?results={max}"); 23 | RandomUserRoot randomUserRoot = 24 | JsonSerializer.Deserialize(jsonResult); 25 | 26 | return randomUserRoot.Results; 27 | } 28 | } -------------------------------------------------------------------------------- /1_Essentials/15_Reconnection/client/index.ts: -------------------------------------------------------------------------------- 1 | import * as signalR from "@microsoft/signalr"; 2 | import CustomRetryPolicy from "./CustomRetryPolicy"; 3 | 4 | var counter = document.getElementById("viewCounter"); 5 | 6 | // create connection 7 | let connection = new signalR.HubConnectionBuilder() 8 | .withUrl("/hub/view") 9 | .withAutomaticReconnect(new CustomRetryPolicy()) 10 | .build(); 11 | 12 | // on view update message from client 13 | connection.on("viewCountUpdate", (value: number) => { 14 | counter.innerText = value.toString(); 15 | }); 16 | 17 | // notify server we're watching 18 | function notify() { 19 | connection.send("notifyWatching"); 20 | } 21 | 22 | // start the connection 23 | function startSuccess() { 24 | console.log("Connected."); 25 | notify(); 26 | } 27 | function startFail() { 28 | console.log("Connection failed."); 29 | } 30 | 31 | connection.start().then(startSuccess, startFail); -------------------------------------------------------------------------------- /1_Essentials/16_DependencyInjection/Services/RandomUserService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Net.Http; 4 | using System.Text.Json; 5 | using System.Threading.Tasks; 6 | 7 | public class RandomUserService : IRandomUserService 8 | { 9 | const string URL = "https://randomuser.me/api/"; 10 | private readonly HttpClient httpClient; 11 | 12 | public RandomUserService(HttpClient httpClient) 13 | { 14 | this.httpClient = httpClient; 15 | } 16 | 17 | public async Task> GetUsers(int max = 1) 18 | { 19 | //?results=5000 MAX 20 | if (max > 5000) max = 5000; 21 | 22 | var jsonResult = await httpClient.GetStringAsync($"{URL}?results={max}"); 23 | RandomUserRoot randomUserRoot = 24 | JsonSerializer.Deserialize(jsonResult); 25 | 26 | return randomUserRoot.Results; 27 | } 28 | } -------------------------------------------------------------------------------- /Demos/todo-application/realtimetodo.client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "module": "esnext", 5 | "strict": true, 6 | "jsx": "preserve", 7 | "importHelpers": true, 8 | "moduleResolution": "node", 9 | "experimentalDecorators": true, 10 | "skipLibCheck": true, 11 | "esModuleInterop": true, 12 | "allowSyntheticDefaultImports": true, 13 | "sourceMap": true, 14 | "baseUrl": ".", 15 | "types": [ 16 | "webpack-env" 17 | ], 18 | "paths": { 19 | "@/*": [ 20 | "src/*" 21 | ] 22 | }, 23 | "lib": [ 24 | "esnext", 25 | "dom", 26 | "dom.iterable", 27 | "scripthost" 28 | ] 29 | }, 30 | "include": [ 31 | "src/**/*.ts", 32 | "src/**/*.tsx", 33 | "src/**/*.vue", 34 | "tests/**/*.ts", 35 | "tests/**/*.tsx" 36 | ], 37 | "exclude": [ 38 | "node_modules" 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scaffold.Web", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "build": "webpack --mode=development --watch", 9 | "release": "webpack --mode=production", 10 | "publish": "npm run release && dotnet publish -c Release" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "clean-webpack-plugin": "4.0.0", 17 | "css-loader": "6.5.1", 18 | "html-webpack-plugin": "5.5.0", 19 | "mini-css-extract-plugin": "2.4.5", 20 | "ts-loader": "9.2.6", 21 | "typescript": "4.5.2", 22 | "webpack": "^5.64.3", 23 | "webpack-cli": "^4.9.1" 24 | }, 25 | "dependencies": { 26 | "@microsoft/signalr": "^8.0.0", 27 | "assets-webpack-plugin": "^7.1.1", 28 | "copy-webpack-plugin": "^10.0.0" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /1_Essentials/13_HubContextOutsideHub/Services/VoteManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using Microsoft.AspNetCore.SignalR; 4 | 5 | public class VoteManager : IVoteManager 6 | { 7 | private static Dictionary votes; 8 | private readonly IHubContext hubContext; 9 | 10 | static VoteManager() 11 | { 12 | votes = new Dictionary(); 13 | votes.Add("pie", 0); 14 | votes.Add("bacon", 0); 15 | } 16 | 17 | public VoteManager(IHubContext hubContext) 18 | { 19 | this.hubContext = hubContext; 20 | } 21 | 22 | public async Task CastVote(string voteFor) 23 | { 24 | votes[voteFor]++; 25 | 26 | // notify 27 | await hubContext.Clients.All.SendAsync("updateVotes", votes); 28 | } 29 | 30 | public Dictionary GetCurrentVotes() 31 | { 32 | return votes; 33 | } 34 | } -------------------------------------------------------------------------------- /1_Essentials/2_Logging/client/index.ts: -------------------------------------------------------------------------------- 1 | import * as signalR from "@microsoft/signalr"; 2 | import { CustomLogger } from "./customLogger"; 3 | 4 | var counter = document.getElementById("viewCounter"); 5 | 6 | // create connection 7 | let connection = new signalR.HubConnectionBuilder() 8 | // .configureLogging(signalR.LogLevel.Trace) 9 | .configureLogging(new CustomLogger()) 10 | .withUrl("/hub/view") 11 | .build(); 12 | 13 | // on view update message from client 14 | connection.on("viewCountUpdate", (value: number) => { 15 | counter.innerText = value.toString(); 16 | }); 17 | 18 | // notify server we're watching 19 | function notify(){ 20 | connection.send("notifyWatching"); 21 | } 22 | 23 | // start the connection 24 | function startSuccess(){ 25 | console.log("Connected."); 26 | notify(); 27 | } 28 | function startFail(){ 29 | console.log("Connection failed."); 30 | } 31 | 32 | connection.start().then(startSuccess, startFail); -------------------------------------------------------------------------------- /1_Essentials/8_ClientEvents/client/index.ts: -------------------------------------------------------------------------------- 1 | import * as signalR from "@microsoft/signalr"; 2 | 3 | let btn = document.getElementById("incrementView"); 4 | let viewCountSpan = document.getElementById("viewCount"); 5 | 6 | // create connection 7 | let connection = new signalR.HubConnectionBuilder() 8 | .withUrl("/hub/view") 9 | .build(); 10 | 11 | btn.addEventListener("click", function (evt) { 12 | // send to hub 13 | connection.invoke("IncrementServerView"); 14 | }); 15 | 16 | // client events 17 | connection.on("incrementView", (val) => { 18 | viewCountSpan.innerText = val; 19 | 20 | if (val % 10 === 0) connection.off("incrementView"); 21 | }); 22 | 23 | // start the connection 24 | function startSuccess() { 25 | console.log("Connected."); 26 | connection.invoke("IncrementServerView"); 27 | } 28 | function startFail() { 29 | console.log("Connection failed."); 30 | } 31 | 32 | connection.start().then(startSuccess, startFail); -------------------------------------------------------------------------------- /Presentations/RealTimeRevolution/src/END/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Real Time Revolution 8 | 9 | 10 | 11 | 12 |

Hi

13 | 14 | 15 |
16 |
17 | 18 | 19 | 20 |
21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /2_Advanced/14_dotnetClient/DotNetClient/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (console)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | "program": "${workspaceFolder}/bin/Debug/net5.0/DotNetClient.dll", 13 | "args": [], 14 | "cwd": "${workspaceFolder}", 15 | "console": "internalConsole", 16 | "stopAtEntry": false 17 | }, 18 | { 19 | "name": ".NET Core Attach", 20 | "type": "coreclr", 21 | "request": "attach", 22 | "processId": "${command:pickProcess}" 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ErrorModel 3 | @{ 4 | ViewData["Title"] = "Error"; 5 | } 6 | 7 |

Error.

8 |

An error occurred while processing your request.

9 | 10 | @if (Model.ShowRequestId) 11 | { 12 |

13 | Request ID: @Model.RequestId 14 |

15 | } 16 | 17 |

Development Mode

18 |

19 | Swapping to the Development environment displays detailed information about the error that occurred. 20 |

21 |

22 | The Development environment shouldn't be enabled for deployed applications. 23 | It can result in displaying sensitive information from exceptions to end users. 24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 25 | and restarting the app. 26 |

27 | -------------------------------------------------------------------------------- /Presentations/RealTimeRevolution/src/START/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Real Time Revolution 9 | 10 | 11 | 12 | 13 | 14 |

Hi

15 | 16 | 17 |
18 |
19 | 20 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using Microsoft.AspNetCore.Mvc.RazorPages; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace _08_1_Authorization.Pages 11 | { 12 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 13 | [IgnoreAntiforgeryToken] 14 | public class ErrorModel : PageModel 15 | { 16 | public string RequestId { get; set; } 17 | 18 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 19 | 20 | private readonly ILogger _logger; 21 | 22 | public ErrorModel(ILogger logger) 23 | { 24 | _logger = logger; 25 | } 26 | 27 | public void OnGet() 28 | { 29 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /1_Essentials/5_ChoosingTransportType/client/index.ts: -------------------------------------------------------------------------------- 1 | import * as signalR from "@microsoft/signalr"; 2 | 3 | // Note: Uncomment this line to DISABLE websockets for testing 4 | //WebSocket = undefined; 5 | 6 | var counter = document.getElementById("viewCounter"); 7 | 8 | // create connection 9 | let connection = new signalR.HubConnectionBuilder() 10 | .withUrl("/hubs/view", { 11 | transport: signalR.HttpTransportType.WebSockets | 12 | signalR.HttpTransportType.ServerSentEvents 13 | }) 14 | .build(); 15 | 16 | // on view update message from client 17 | connection.on("viewCountUpdate", (value: number) => { 18 | counter.innerText = value.toString(); 19 | }); 20 | 21 | // notify server we're watching 22 | function notify() { 23 | connection.send("notifyWatching"); 24 | } 25 | 26 | // start the connection 27 | function startSuccess() { 28 | console.log("Connected."); 29 | notify(); 30 | } 31 | function startFail() { 32 | console.log("Connection failed."); 33 | } 34 | 35 | connection.start().then(startSuccess, startFail); -------------------------------------------------------------------------------- /1_Essentials/2_Logging/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Scaffold.Web 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureLogging(logging => 22 | { 23 | logging.AddFilter("Microsoft.AspNetCore.SignalR", LogLevel.Trace); 24 | logging.AddFilter("Microsoft.AspNetCore.Http.Connections", LogLevel.Trace); 25 | }) 26 | .ConfigureWebHostDefaults(webBuilder => 27 | { 28 | webBuilder.UseStartup(); 29 | }); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /1_Essentials/14_HubLifecycle/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Scaffold.Web 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureLogging(configure => { 22 | configure.ClearProviders(); 23 | configure.AddConsole(); 24 | configure.AddFilter("VoteHub", LogLevel.Debug); 25 | }) 26 | .ConfigureWebHostDefaults(webBuilder => 27 | { 28 | webBuilder.UseStartup(); 29 | }); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /2_Advanced/08-1_Authorization/Pages/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Identity 2 | @inject SignInManager SignInManager 3 | @inject UserManager UserManager 4 | 5 | 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SignalR Mastery 2 | Source code and examples for my SignalR Mastery course. 3 | 4 | Not in the course? Join today @ https://signalrmastery.com 5 | 6 | ## Prereqs 7 | 8 | * Node.JS 12.x or higher 9 | * .NET 5 (We use .NET 5, but examples should still be good on older versions such as .NET Core 2.x or .NET Core 3.x) 10 | 11 | > Need the .NET SDK? [Check out my YouTube video](https://www.youtube.com/watch?v=karSxhTb_38) 12 | 13 | ## How to Run Any Example 14 | 15 | 1. Navigate to the folder containing the example you're interested in running. 16 | 17 | 2. `npm run i` to install the missing NPM packages 18 | 19 | 3. Start WebPack: `npm run build` 20 | 21 | 4. Start .NET `dotnet run` or press F5 from Visual Studio/Visual Studio Code 22 | 23 | ## How to ask for help? 24 | 25 | This repository is support for members of my course "SignalR Mastery". The easiest and fastest way to get your questions answered is to join that community, and ask a question there. 26 | 27 | Your questions will be answered, but also turned into content so others might be able to benefit from the awesome questions you ask. 28 | -------------------------------------------------------------------------------- /1_Essentials/11_Groups/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | const HtmlWebpackPlugin = require("html-webpack-plugin"); 3 | const { CleanWebpackPlugin } = require("clean-webpack-plugin"); 4 | const MiniCssExtractPlugin = require("mini-css-extract-plugin"); 5 | module.exports = { 6 | entry: "./client/index.ts", 7 | output: { 8 | path: path.resolve(__dirname, "wwwroot"), 9 | filename: "[name].[chunkhash].js", 10 | publicPath: "/" 11 | }, 12 | resolve: { 13 | extensions: [".js", ".ts"] 14 | }, 15 | module: { 16 | rules: [ 17 | { 18 | test: /\.ts$/, 19 | use: "ts-loader" 20 | }, 21 | { 22 | test: /\.css$/, 23 | use: [MiniCssExtractPlugin.loader, "css-loader"] 24 | } 25 | ] 26 | }, 27 | plugins: [ 28 | new CleanWebpackPlugin(), 29 | new HtmlWebpackPlugin({ 30 | template: "./client/index.html" 31 | }), 32 | new MiniCssExtractPlugin({ 33 | filename: "css/[name].[chunkhash].css" 34 | }) 35 | ] 36 | }; -------------------------------------------------------------------------------- /1_Essentials/2_Logging/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | const HtmlWebpackPlugin = require("html-webpack-plugin"); 3 | const { CleanWebpackPlugin } = require("clean-webpack-plugin"); 4 | const MiniCssExtractPlugin = require("mini-css-extract-plugin"); 5 | module.exports = { 6 | entry: "./client/index.ts", 7 | output: { 8 | path: path.resolve(__dirname, "wwwroot"), 9 | filename: "[name].[chunkhash].js", 10 | publicPath: "/" 11 | }, 12 | resolve: { 13 | extensions: [".js", ".ts"] 14 | }, 15 | module: { 16 | rules: [ 17 | { 18 | test: /\.ts$/, 19 | use: "ts-loader" 20 | }, 21 | { 22 | test: /\.css$/, 23 | use: [MiniCssExtractPlugin.loader, "css-loader"] 24 | } 25 | ] 26 | }, 27 | plugins: [ 28 | new CleanWebpackPlugin(), 29 | new HtmlWebpackPlugin({ 30 | template: "./client/index.html" 31 | }), 32 | new MiniCssExtractPlugin({ 33 | filename: "css/[name].[chunkhash].css" 34 | }) 35 | ] 36 | }; -------------------------------------------------------------------------------- /1_Essentials/12_MessageSizes/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | const HtmlWebpackPlugin = require("html-webpack-plugin"); 3 | const { CleanWebpackPlugin } = require("clean-webpack-plugin"); 4 | const MiniCssExtractPlugin = require("mini-css-extract-plugin"); 5 | module.exports = { 6 | entry: "./client/index.ts", 7 | output: { 8 | path: path.resolve(__dirname, "wwwroot"), 9 | filename: "[name].[chunkhash].js", 10 | publicPath: "/" 11 | }, 12 | resolve: { 13 | extensions: [".js", ".ts"] 14 | }, 15 | module: { 16 | rules: [ 17 | { 18 | test: /\.ts$/, 19 | use: "ts-loader" 20 | }, 21 | { 22 | test: /\.css$/, 23 | use: [MiniCssExtractPlugin.loader, "css-loader"] 24 | } 25 | ] 26 | }, 27 | plugins: [ 28 | new CleanWebpackPlugin(), 29 | new HtmlWebpackPlugin({ 30 | template: "./client/index.html" 31 | }), 32 | new MiniCssExtractPlugin({ 33 | filename: "css/[name].[chunkhash].css" 34 | }) 35 | ] 36 | }; -------------------------------------------------------------------------------- /1_Essentials/14_HubLifecycle/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | const HtmlWebpackPlugin = require("html-webpack-plugin"); 3 | const { CleanWebpackPlugin } = require("clean-webpack-plugin"); 4 | const MiniCssExtractPlugin = require("mini-css-extract-plugin"); 5 | module.exports = { 6 | entry: "./client/index.ts", 7 | output: { 8 | path: path.resolve(__dirname, "wwwroot"), 9 | filename: "[name].[chunkhash].js", 10 | publicPath: "/" 11 | }, 12 | resolve: { 13 | extensions: [".js", ".ts"] 14 | }, 15 | module: { 16 | rules: [ 17 | { 18 | test: /\.ts$/, 19 | use: "ts-loader" 20 | }, 21 | { 22 | test: /\.css$/, 23 | use: [MiniCssExtractPlugin.loader, "css-loader"] 24 | } 25 | ] 26 | }, 27 | plugins: [ 28 | new CleanWebpackPlugin(), 29 | new HtmlWebpackPlugin({ 30 | template: "./client/index.html" 31 | }), 32 | new MiniCssExtractPlugin({ 33 | filename: "css/[name].[chunkhash].css" 34 | }) 35 | ] 36 | }; --------------------------------------------------------------------------------