C# 7 New Features
In this article, I am going to discuss C# 7 New Features with Examples. The C# 7 comes with a number of new features which bring a focus on data consumption, code simplification, and performance.
I think the biggest C# 7 new features are Tuples and Pattern Matching. Now you can return multiple different or the same type of values from a method using Tuples. Pattern Matching is the concept that is used to simplify the code that is based on the condition, creating the appropriate object. Along with these two features, there are also many other features are also introduced. In this article, we are going to discuss what are the new features introduced in C# 7. Please have a look at the following diagram.
Following are the New Features that are introduced as part of C# 7
- Out variables and Discards
- Pattern matching
- Digit Separators
- Deconstruction (Splitting Tuples)
- Local functions
- Ref returns and Ref locals
- Generalized async return types
- Expression bodied members
- Throw expressions
- Async main
We are going to discuss each of these new features in detail with Examples from our next articles. In the next article, I am going to discuss the Out Variables in C# 7 with Examples.
The most important point that you need to keep in mind is we are going to use Visual Studio 2017 and a later version with Dot Net framework 4.7.x. Please be ready with visual studio 2017 or a later version.
About the Author: Pranaya Rout
Pranaya Rout has published more than 3,000 articles in his 11-year career. Pranaya Rout has very good experience with Microsoft Technologies, Including C#, VB, ASP.NET MVC, ASP.NET Web API, EF, EF Core, ADO.NET, LINQ, SQL Server, MYSQL, Oracle, ASP.NET Core, Cloud Computing, Microservices, Design Patterns and still learning new technologies.