- SignalR Blueprints
- Einar Ingebrigtsen
- 288字
- 2021-07-23 20:36:23
The goal – how to create a basic forum discussion site
Forums have been around since the dawn of computing, taking on many forms: bulletin board systems, user groups, and also web-based forums on different sites. In this chapter, we'll build our own forum and light it up with SignalR, improving the overall user experience and also scalability of the solution. We'll use the top-level abstraction within SignalR called a hub. The hub enables us to expose methods from the server directly to the client and also makes it possible to call functions on the client side from the server directly.
By the end of the chapter, you'll understand the basics of SignalR and how to use the top-level abstraction: hub. Also, you will briefly look at what MVC gives you in combination with Entity Framework.
So, let's just jump straight into it!
Hub
At the core level of SignalR sits something called a PersistentConnection
class; hubs build on top of this. We won't be covering PersistentConnection
as it is far more convenient to be working with the hub. In my opinion, a hub is the preferred abstraction to use; most applications really don't need to go any lower than this. It provides functionality to define functionality on the server in a C# class, much like an MVC or a Web API controller with the exception of it being persistently connected, leaving it possible to also call functionality on the client as well. The clients consume the hub and can directly call the methods on them. However, these clients can also register the client functions it responds to and create a subscription from the client that makes it respond to what it registered when the server calls it.
- Java 開發從入門到精通(第2版)
- Visual FoxPro程序設計教程
- Rust編程從入門到實戰
- Flask Web開發入門、進階與實戰
- OpenCV for Secret Agents
- Full-Stack Vue.js 2 and Laravel 5
- Modern JavaScript Applications
- Python完全自學教程
- Learning JavaScript Data Structures and Algorithms
- Android開發:從0到1 (清華開發者書庫)
- SQL Server從入門到精通(第3版)
- SQL Server與JSP動態網站開發
- RealSenseTM互動開發實戰
- Android開發三劍客:UML、模式與測試
- 零基礎學HTML+CSS