Book Image

Learn C# in 7 days

By : Gaurav Aroraa
1 (1)
Book Image

Learn C# in 7 days

1 (1)
By: Gaurav Aroraa

Overview of this book

This book takes a unique approach to teach C# to absolute beginners. You’ll learn the basics of the language in seven days. It takes a practical approach to explain the important concepts that build the foundation of the C# programming language. The book begins by teaching you the basic fundamentals using real-world practical examples and gets you acquainted with C# programming. We cover some important features and nuances of the language in a hands-on way, helping you grasp the concepts in a fluid manner. Later, you’ll explore the concepts of Object-Oriented Programming (OOP) through a real-world example. Then we dive into advanced-level concepts such as generics and collections, and you’ll get acquainted with objects and LINQ. Towards the end, you’ll build an application that covers all the concepts explained in the book. By the end of this book, you will have next-level skills and a good knowledge of the fundamentals of C#.
Table of Contents (15 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Understanding a typical C# program


Before we start writing a program in C#, let's first go back to day one, where we discussed the various IDEs and editors that are helpful in writing programs/applications using the C# language. Revisit day one and understand various editors and IDEs and check why we should go with one of our choice. We will be using Visual Studio 2017 update 3 for all our examples in this book.

Note

To know the steps to install Visual Studio 2017, refer to https://docs.microsoft.com/en-us/visualstudio/install/install-visual-studio.

To get start with a simple C# program (we will create a console application), follow these steps:

  1. Initiate your Visual Studio.
  2. Go to File | New | Project (or ctrl +Shift + N).
  3. Under Visual C# node, select .NET Core and then select Console App.
  4. Name your program, say, Day02, and click on OK (see highlighted text in the following figure):

You will get the following code in class Program.cs – this is the default code provided by Visual Studio; you can amend...