Book Image

C# 7.1 and .NET Core 2.0 ??? Modern Cross-Platform Development - Third Edition

By : Mark J. Price
Book Image

C# 7.1 and .NET Core 2.0 ??? Modern Cross-Platform Development - Third Edition

By: Mark J. Price

Overview of this book

C# 7.1 and .NET Core 2.0 – Modern Cross-Platform Development, Third Edition, is a practical guide to creating powerful cross-platform applications with C# 7.1 and .NET Core 2.0. It gives readers of any experience level a solid foundation in C# and .NET. The first part of the book runs you through the basics of C#, as well as debugging functions and object-oriented programming, before taking a quick tour through the latest features of C# 7.1 such as default literals, tuples, inferred tuple names, pattern matching, out variables, and more. After quickly taking you through C# and how .NET works, this book dives into the .NET Standard 2.0 class libraries, covering topics such as packaging and deploying your own libraries, and using common libraries for working with collections, performance, monitoring, serialization, files, databases, and encryption. The final section of the book demonstrates the major types of application that you can build and deploy cross-device and cross-platform. In this section, you'll learn about websites, web applications, web services, Universal Windows Platform (UWP) apps, and mobile apps. By the end of the book, you'll be armed with all the knowledge you need to build modern, cross-platform applications using C# and .NET.
Table of Contents (31 chapters)
Title Page
Credits
About the Author
About the Reviewers
www.PacktPub.com
Customer Feedback
Preface
2
Part 1 – C# 7.1
8
Part 2 – .NET Core 2.0 and .NET Standard 2.0
16
Part 3 – App Models
22
Summary
Index

Managing source code with GitHub


Gitis a commonly used source code management system. GitHub is a company, website, and desktop application that makes it easier to manage Git.

I used GitHub to store solutions to all the practical exercises at the end of each chapter at the following URL:

https://github.com/markjprice/cs7dotnetcore2

Using Git with Visual Studio 2017

Visual Studio 2017 has built-in support for using Git with GitHub as well as Microsoft's own source code management system named Visual Studio Team Services (VSTS).

Using the Team Explorer window

In Visual Studio 2017, navigate to View | Team Explorer, as shown in the following screenshot:

Although it is a good idea to sign up with an online source code management system provider, you can clone a GitHub repository without signing up for an account.

Cloning a GitHub repository

In the Team Explorer window, expand Local Git Repositories, click on the Clone menu, and then enter the following URL of a Git repository to clone it:

https://github.com/markjprice/cs7dotnetcore2.git

Enter a path for the cloned Git repository:

C:\Code\Repos\cs7dotnetcore2

Click on the Clone button, as shown in the following screenshot:

Wait for the Git repository to clone locally.

You will now have a local copy of the complete solutions to all of the hands-on practice exercises for this book.

Managing a GitHub repository

Double-click on the cs7dotnetcore2 repo to open a detail view.

You can click on the options in the Project section to view Pull Requests and Issues, and other aspects of a repository.

You can double-click on an entry in the Solutions section to open it in Solution Explorer.

Using Git with Visual Studio Code

Visual Studio Code has support for Git, but it will use your OS's Git installation, so you must install Git 2.0 or later first before you get these features. You can install Git from the following link:

https://git-scm.com/download

Note

If you like to use a GUI, you can download GitHub Desktop from the following link:https://desktop.github.com

Configuring Git at the command line

Launch Terminal, and enter the following command to check your configuration:

git config --list

The output should include your username and email address, because these will be used with every commit that you make:

...other congfiguration...
user.name=Mark J. Price
[email protected]

If your username and email has not been set, to set your username and email, enter the following commands, using your own name and email, not mine:

git config --global user.name "Mark J. Price"
git config --global user.email [email protected]

You can check an individual configuration setting like this:

git config user.name

Managing Git with Visual Studio Code

Launch Visual Studio Code, and open the Code folder.

Navigate toView | Integrated Terminal or press Ctrl + `, and enter the following commands:

mkdir Repos
cd Repos
git clone https://github.com/markjprice/cs7dotnetcore2.git

Cloning all of the solutions for all of the chapters to your local drive will take a minute, as shown in the following screenshot:

Note

For more information about source code version control with Visual Studio Code, visit the following link:https://code.visualstudio.com/Docs/editor/versioncontrol