This is the code repository for .NET Core 2.0 By Example, published by Packt. It contains all the supporting project files necessary to work through the book from start to finish.
With the rise in the number of tools and technologies available today, developers and architects are always exploring ways to create better and smarter solutions. Before, the differences between target platforms was a major roadblock, but that's not the case now. .NET Core 2.0 By Example will take you on an exciting journey to building better software.
This book provides fresh and relevant content to .NET Core 2.0 in a succinct format that’s enjoyable to read. It also delivers concepts, along with the implications, design decisions, and potential pitfalls you might face when targeting Linux and Windows systems, in a logical and simple way.
With the .NET framework at its center, the book comprises of four varied projects: a multiplayer Tic-tac-toe game; a real-time chat application, Let'sChat; a chatbot; and a movie booking application. You will start each chapter with a high-level overview of the content, followed by the above example applications described in detail. By the end of each chapter, you will not only be proficient with the concepts, but you’ll also have created a tangible component in the application.
By the end of the book, you will have built four solid projects using all the tools and support provided by the .NET Core 2.0 framework.
All of the code is organized into folders. Each folder starts with a number followed by the application name. For example, Chapter02.
For C# and .NET Core Samples: Open the Packt.DotNetCore2ByExamples.Examples.sln solution file in Visual Studio 2017
For F# Project: Open the F# sample project solution in Visual Studio 2017 and run the app.
For C++ and Ubuntu code samples: Ubuntu Code samples should be downloaded and opened with Visual Studio Code. C++ ExampleDll solution can be directly opened in Visual Studio 2017.
The code will look like the following:
# include<stdio.h>
int hello()
{
return 15;
}
This book is aimed at experienced developers who use different platforms—Windows, Linux, Ubuntu, macOS—and want to try Microsoft .NET Core 2.0 cross platform. Developers using C#, C, or C++ for development who are interested in extending their knowledge of functional programming, beginners who want to understand F# and functional programming, we assume that you have a basic understanding of C# and are aware of the .NET framework and Windows.
The below section summarizes the chapter wise content and demo links.
- Getting started with .NET Core 2.0 and required setup.
- Getting started with F# and required setup.
- Getting started with PInvoke using .NET Core
- Introduction to NCurse and how to consume it from .NET Core
- Configuring services in ASP.NET Core apps.
- Configuring and using SignalR Core with ASP.NET Core
- The above link would take you to Register page. Register with your name and display image (size should be less than 1 MB) that you wish to use for playing instead of X or O icon, and click Register button.
- Upon registration, user would be navigated to the "Find Opponent Player" screen, to find an opponent player, against which you can play. Click on the button to find if you have any opponent player. If you don't find anyone, ask your friend to register and find opponent player. Both of you, should now be able to play a game of tic-tac-toe. Enjoy the game!
- Integrating Facebook login with your ASP.NET Core app. Google/Microsoft/Twitter can be learnt and tried from ASP.NET Core documentation
- Using configuration.
- Intro to authorization and authentication.
- Learn to develop simple FAQ BOT.
- Get started with simple unit tests.
Let's Chat - Online Chat Room
- The above link would redirect to Facebook login screen (if you are not already logged in to Facebook). Instead of fetching the user name and image from the user input, the app uses your Facebook profile to get user name and profile picture.
- Upon login, user would be redirected to Chat Room page. You would be able to chat with all the logged in people in the Let's Chat app. It displays the message when a user joins or leaves the room and also shows Online Users on the left panel. Happy chatting!
Reference to Cloud Storage Resources with .NET Core 2.0
- Getting started with Entity Framework Core.
- Learn to do simple CRUD operations using ASP.NET Core 2.0 and apply migrations.
- Deploy an ASP.NET Core app to Azure.
- Introduction to Razor pages. I feel Razor pages makes UI development fast and controller approach can be used to make Web APIs. This choice of UI and API development should be very productive, while still maintaining separation of concerns.
Just browse the link. The data is fetched from the DataStore class and getting it from SQL database (as hosting and deploying on Azure is a cost) is left as an exercise to the reader. Please refer to Getting Started With EF Core sample to accomplish the same.
Chat with ASP.NET Core FAQ BOT and do simple converstaion like Hi, Why ASP.NET Core, MVC, about book, etc. Have Fun !
- Introduction to Blazor.
- Open the Packt.DotNetCore2ByExamples.Examples.sln solution file in Visual Studio 2017
- Run the app as per chapter information given above.
- Open the F# sample project solution in Visual Studio 2017 and run the app.
- Ubuntu Code samples should be downloaded and opened with Visual Studio Code.
- C++ ExampleDll solution can be directly opened in Visual Studio 2017.
For a thorough undertsanding and extended reading, following resources are recommended:
- ASP.NET Documentation
- Entity Framework Core Source Code
- ASP.NET Core MVC Source Code
- Kestrel Server Source Code
- New Announcements from ASP.NET - Keep this repo on watch list for latest and greated updates.
- ASP.NET Core docker images
- SignalR Core Source Code
- ASP.NET Home Repository - Keep exploring, keep learning.
Though the demo apps should work in all modern browsers, we only checked them against Chrome, so in case you face any issues in other browsers, please try using Chrome browser for demos. For any issues, questions, suggestions or constructive feedback, please contact Rishabh Verma or Neha Shrivastava
If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to download a free PDF copy of this book.