Skip to Main Content
.NET Core 2.0 By Example
book

.NET Core 2.0 By Example

by Neha Shrivastava, Rishabh Verma
March 2018
Beginner to intermediate content levelBeginner to intermediate
458 pages
10h 34m
English
Packt Publishing
Content preview from .NET Core 2.0 By Example

Coding the game

In this section, we will implement our gaming solution. The end output will be the working two-player Tic-Tac-Toe game. We will do the coding in steps for ease of understanding:

  1.  In the Startup class, we modify the ConfigureServices method to add SignalR to the container, by writing the following code:
//// Adds SignalR to the services container. services.AddSignalR();
  1. In the Configure method of the same class, we configure the pipeline to use SignalR and intercept and wire up the request containing gameHub to our SignalR hub that we will be creating with the following code:
//// Use - SignalR & let it know to intercept and map any request having gameHub. app.UseSignalR(routes =>  {        routes.MapHub<GameHub>("gameHub");
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ASP.NET Core 3 and React

ASP.NET Core 3 and React

Carl Rippon
Enterprise Application Development with C# 9 and .NET 5

Enterprise Application Development with C# 9 and .NET 5

Ravindra Akella, Rishabh Verma, Arun Kumar Tamirisa, Suneel Kumar Kunani, Bhupesh Guptha Muthiyalu

Publisher Resources

ISBN: 9781788395090Supplemental Content