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

Tuples and deconstruction


Tuples have not been newly introduced in the current version but were introduced with the .NET 4.0 release. In the present release, they have been improved.

Tuples

Tuples are there at whatever point a particular case needs to return multiple values from a method. For instance, let's say we have to find odd and even numbers from a given number series.

Note

Tuples are an unchanging information esteem that hold related data. Tuples used to aggregate together related data, for example, such that a person's name, age, gender and whatever you want data as an information.

To complete this, our method should return or provide us the result with a number and saying whether this is an odd number or even number. For a method that will return these multiple values, we could use custom datatypes, dynamic return types, or out parameters, which sometimes will create confusion for a developer.

Note

To use tuples, you need to add the NuGet package:https://www.nuget.org/packages/System...