SlideShare a Scribd company logo
1 of 23
C#
6.0 & 7.0
Features
Carlos Landeras Martínez
Software Engineer at Plain Concepts
@carlos_lande
carlos.landeras@gmail.com
¿Who Am I?
A little bit of C# History
What’s What was new in C# 6.0
Read-only auto-properties
Auto-Property Initializers
Expression-bodied function members
Using Static
Null – Conditional Operators
String Interpolation
Exception filters
nameof Expressions
Await in catch and finally blocks
Index initializers
Read Only Auto Properties
Read-only auto-properties provide a more concise syntax to create immutable types, in previous C# Versions
the compiler only enforces properties not to be modified outside the class.
Read Only Auto Properties, enable true read-only behaviour, and true language support for immutable types
Note* : Read Only properties must be set inside the body of class constructor, trying to set them in other block
of code would end with a CS 0200 compilation error
Auto Property Initializers
Allows initialization of an Auto Property as part of the property declaration.
Expression bodied Function Members
The body of a lot of members that we write consist of only one statement that can be represented as an
expression
Using Static
The using static enhancement enables you to import the static methods of a single class.
Null Conditional Operator
Stop complicating your code by checking Null when accessing variables!. Yiiiiihaaaa!
String Interpolation
Welcome to the new Syntax for composing strings!
Exception filters
Determine when a given catch clause should be applied
Nameof Expression
The nameof expression evaluates to the name of a symbol
Await in catch and finally blocks
C# 6.0 allows to use await keyword y catch and finally blocks.
Index Initializers
Allow collection initialization to be more consistent. In earlier versions, we could use collection initializers
with sequence style collections, now we can even use them with Dictionaries.
What is new in C# 7.0
Expresion bodied members
Pattern Matching (Is)
Pattern Matching (Switch)
Local Functions
Inline Out variables
Returns by reference
Throw expressions
Tuples
Deconstructions
Async return types (ValueTask)
Expression bodied members
In C# 6.0 we had expression bodied function members, and this version has added accessors, constructors
and finalizers
Pattern Matching (is)
Syntactic elements that can test that a value has a certain “shape”, and extract information from the value
when it does.
Pattern Matching (Switch)
You can now switch on any type, not just primitive types.
Patterns can use case clauses, and this clauses can have additional conditions on them.
Local functions
If your helper function only makes sense inside the single method that is consuming it. You can now
declare it as a local function.
Inline out variables
Before C# 6.0, you had to declare variables you pass to out parameters, it is a little bit pointless since this
value will be overwritten. In C# 7.0 you can declare and use them inline.
Throw expressions
It is now possible to throw an exception in the middle of an expression ;)
Tuples and deconstructions
Tuples have arrived to C# 7.0!. You can stop creating dummy objects to return more than one value. The
options until now were:
• System.Tuple (Verbose and require allocation)
• Out parameters (Use is awkward, not working in async methods)
• Anonymous types through a dynamic. (overhead and no type checking)
Tuples are a new value type in C# language. This means Performance (no overhead like old Tuple, that
stored a class instance) and new software design capabilities.
Async return types
C# 7.0 introduces ValueTask. The main advantage of this new struct, it’s to prevent the Allocation of a new
Task<T> object in cases where the result of the async operation is already available at the time of awaiting.

More Related Content

What's hot

What's hot (19)

IOS Swift language 2nd tutorial
IOS Swift language 2nd tutorialIOS Swift language 2nd tutorial
IOS Swift language 2nd tutorial
 
AST for JavaScript developers
AST for JavaScript developersAST for JavaScript developers
AST for JavaScript developers
 
SV-ios-objc-to-swift
SV-ios-objc-to-swiftSV-ios-objc-to-swift
SV-ios-objc-to-swift
 
Javascript by Yahoo
Javascript by YahooJavascript by Yahoo
Javascript by Yahoo
 
Chapter 07
Chapter 07 Chapter 07
Chapter 07
 
C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#
 
Unit 2.5
Unit 2.5Unit 2.5
Unit 2.5
 
c# at f#
c# at f#c# at f#
c# at f#
 
JAVASCRIPT - LinkedIn
JAVASCRIPT - LinkedInJAVASCRIPT - LinkedIn
JAVASCRIPT - LinkedIn
 
Scope demystified - AngularJS
Scope demystified - AngularJSScope demystified - AngularJS
Scope demystified - AngularJS
 
IBDesignable & IBInspectible
IBDesignable & IBInspectibleIBDesignable & IBInspectible
IBDesignable & IBInspectible
 
Getting Started With Kotlin
Getting Started With KotlinGetting Started With Kotlin
Getting Started With Kotlin
 
Doppl development iteration #5
Doppl development   iteration #5Doppl development   iteration #5
Doppl development iteration #5
 
TypeScript and Angular workshop
TypeScript and Angular workshopTypeScript and Angular workshop
TypeScript and Angular workshop
 
Implementing the Adapter Design Pattern
Implementing the Adapter Design PatternImplementing the Adapter Design Pattern
Implementing the Adapter Design Pattern
 
Iq rails
Iq railsIq rails
Iq rails
 
Designing Better API
Designing Better APIDesigning Better API
Designing Better API
 
Virtual function and abstract class
Virtual function and abstract classVirtual function and abstract class
Virtual function and abstract class
 
Akka introtalk HyScala DEC 2016
Akka introtalk HyScala DEC 2016Akka introtalk HyScala DEC 2016
Akka introtalk HyScala DEC 2016
 

Similar to C# 6.0 and 7.0 new features

Similar to C# 6.0 and 7.0 new features (20)

csharp.docx
csharp.docxcsharp.docx
csharp.docx
 
C++ Training
C++ TrainingC++ Training
C++ Training
 
New features in C# 6
New features in C# 6New features in C# 6
New features in C# 6
 
Before you jump into Angular
Before you jump into AngularBefore you jump into Angular
Before you jump into Angular
 
Web technologies-course 07.pptx
Web technologies-course 07.pptxWeb technologies-course 07.pptx
Web technologies-course 07.pptx
 
Introduction of C++ By Pawan Thakur
Introduction of C++ By Pawan ThakurIntroduction of C++ By Pawan Thakur
Introduction of C++ By Pawan Thakur
 
Chapter3: fundamental programming
Chapter3: fundamental programmingChapter3: fundamental programming
Chapter3: fundamental programming
 
compose 3.pptx
compose 3.pptxcompose 3.pptx
compose 3.pptx
 
Apple’s New Swift Programming Language Takes Flight With New Enhancements And...
Apple’s New Swift Programming Language Takes Flight With New Enhancements And...Apple’s New Swift Programming Language Takes Flight With New Enhancements And...
Apple’s New Swift Programming Language Takes Flight With New Enhancements And...
 
C_plus_plus
C_plus_plusC_plus_plus
C_plus_plus
 
Bcsl 031 solve assignment
Bcsl 031 solve assignmentBcsl 031 solve assignment
Bcsl 031 solve assignment
 
9054799 dzone-refcard267-kotlin
9054799 dzone-refcard267-kotlin9054799 dzone-refcard267-kotlin
9054799 dzone-refcard267-kotlin
 
2.Getting Started with C#.Net-(C#)
2.Getting Started with C#.Net-(C#)2.Getting Started with C#.Net-(C#)
2.Getting Started with C#.Net-(C#)
 
Spring framework Controllers and Annotations
Spring framework   Controllers and AnnotationsSpring framework   Controllers and Annotations
Spring framework Controllers and Annotations
 
What's Coming in C# 9.0
What's Coming in C# 9.0What's Coming in C# 9.0
What's Coming in C# 9.0
 
Inline functions & macros
Inline functions & macrosInline functions & macros
Inline functions & macros
 
C# AND F#
C# AND F#C# AND F#
C# AND F#
 
The Little Wonders of C# 6
The Little Wonders of C# 6The Little Wonders of C# 6
The Little Wonders of C# 6
 
Introduction to C++ Programming
Introduction to C++ ProgrammingIntroduction to C++ Programming
Introduction to C++ Programming
 
Dot net programming concept
Dot net  programming conceptDot net  programming concept
Dot net programming concept
 

More from Carlos Landeras Martínez

Dotnet2019 Asp .Net Core Good Practices 2019
Dotnet2019 Asp .Net Core Good Practices 2019Dotnet2019 Asp .Net Core Good Practices 2019
Dotnet2019 Asp .Net Core Good Practices 2019Carlos Landeras Martínez
 
Carlos Landeras - Tech Summit - Aplicaciones corporativas descentralizadas co...
Carlos Landeras - Tech Summit - Aplicaciones corporativas descentralizadas co...Carlos Landeras - Tech Summit - Aplicaciones corporativas descentralizadas co...
Carlos Landeras - Tech Summit - Aplicaciones corporativas descentralizadas co...Carlos Landeras Martínez
 
.Net Core Real time App on My Rasperry PI - Codemotion 2017 talk
.Net Core Real time App on My Rasperry PI - Codemotion 2017 talk.Net Core Real time App on My Rasperry PI - Codemotion 2017 talk
.Net Core Real time App on My Rasperry PI - Codemotion 2017 talkCarlos Landeras Martínez
 
Plainconcepts .Net Core Event - Real Time Applications
Plainconcepts .Net Core Event - Real Time ApplicationsPlainconcepts .Net Core Event - Real Time Applications
Plainconcepts .Net Core Event - Real Time ApplicationsCarlos Landeras Martínez
 
Machine learning for dummies - Azuges November 2016
Machine learning for dummies - Azuges November 2016Machine learning for dummies - Azuges November 2016
Machine learning for dummies - Azuges November 2016Carlos Landeras Martínez
 

More from Carlos Landeras Martínez (7)

Dotnet2019 Asp .Net Core Good Practices 2019
Dotnet2019 Asp .Net Core Good Practices 2019Dotnet2019 Asp .Net Core Good Practices 2019
Dotnet2019 Asp .Net Core Good Practices 2019
 
Carlos Landeras - Tech Summit - Aplicaciones corporativas descentralizadas co...
Carlos Landeras - Tech Summit - Aplicaciones corporativas descentralizadas co...Carlos Landeras - Tech Summit - Aplicaciones corporativas descentralizadas co...
Carlos Landeras - Tech Summit - Aplicaciones corporativas descentralizadas co...
 
SignalR is coming talk slides
SignalR is coming talk slidesSignalR is coming talk slides
SignalR is coming talk slides
 
Plain concepts webday- Carlos Landeras
Plain concepts webday- Carlos LanderasPlain concepts webday- Carlos Landeras
Plain concepts webday- Carlos Landeras
 
.Net Core Real time App on My Rasperry PI - Codemotion 2017 talk
.Net Core Real time App on My Rasperry PI - Codemotion 2017 talk.Net Core Real time App on My Rasperry PI - Codemotion 2017 talk
.Net Core Real time App on My Rasperry PI - Codemotion 2017 talk
 
Plainconcepts .Net Core Event - Real Time Applications
Plainconcepts .Net Core Event - Real Time ApplicationsPlainconcepts .Net Core Event - Real Time Applications
Plainconcepts .Net Core Event - Real Time Applications
 
Machine learning for dummies - Azuges November 2016
Machine learning for dummies - Azuges November 2016Machine learning for dummies - Azuges November 2016
Machine learning for dummies - Azuges November 2016
 

Recently uploaded

Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 

Recently uploaded (20)

Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 

C# 6.0 and 7.0 new features

  • 2. Carlos Landeras Martínez Software Engineer at Plain Concepts @carlos_lande carlos.landeras@gmail.com ¿Who Am I?
  • 3. A little bit of C# History
  • 4. What’s What was new in C# 6.0 Read-only auto-properties Auto-Property Initializers Expression-bodied function members Using Static Null – Conditional Operators String Interpolation Exception filters nameof Expressions Await in catch and finally blocks Index initializers
  • 5. Read Only Auto Properties Read-only auto-properties provide a more concise syntax to create immutable types, in previous C# Versions the compiler only enforces properties not to be modified outside the class. Read Only Auto Properties, enable true read-only behaviour, and true language support for immutable types Note* : Read Only properties must be set inside the body of class constructor, trying to set them in other block of code would end with a CS 0200 compilation error
  • 6. Auto Property Initializers Allows initialization of an Auto Property as part of the property declaration.
  • 7. Expression bodied Function Members The body of a lot of members that we write consist of only one statement that can be represented as an expression
  • 8. Using Static The using static enhancement enables you to import the static methods of a single class.
  • 9. Null Conditional Operator Stop complicating your code by checking Null when accessing variables!. Yiiiiihaaaa!
  • 10. String Interpolation Welcome to the new Syntax for composing strings!
  • 11. Exception filters Determine when a given catch clause should be applied
  • 12. Nameof Expression The nameof expression evaluates to the name of a symbol
  • 13. Await in catch and finally blocks C# 6.0 allows to use await keyword y catch and finally blocks.
  • 14. Index Initializers Allow collection initialization to be more consistent. In earlier versions, we could use collection initializers with sequence style collections, now we can even use them with Dictionaries.
  • 15. What is new in C# 7.0 Expresion bodied members Pattern Matching (Is) Pattern Matching (Switch) Local Functions Inline Out variables Returns by reference Throw expressions Tuples Deconstructions Async return types (ValueTask)
  • 16. Expression bodied members In C# 6.0 we had expression bodied function members, and this version has added accessors, constructors and finalizers
  • 17. Pattern Matching (is) Syntactic elements that can test that a value has a certain “shape”, and extract information from the value when it does.
  • 18. Pattern Matching (Switch) You can now switch on any type, not just primitive types. Patterns can use case clauses, and this clauses can have additional conditions on them.
  • 19. Local functions If your helper function only makes sense inside the single method that is consuming it. You can now declare it as a local function.
  • 20. Inline out variables Before C# 6.0, you had to declare variables you pass to out parameters, it is a little bit pointless since this value will be overwritten. In C# 7.0 you can declare and use them inline.
  • 21. Throw expressions It is now possible to throw an exception in the middle of an expression ;)
  • 22. Tuples and deconstructions Tuples have arrived to C# 7.0!. You can stop creating dummy objects to return more than one value. The options until now were: • System.Tuple (Verbose and require allocation) • Out parameters (Use is awkward, not working in async methods) • Anonymous types through a dynamic. (overhead and no type checking) Tuples are a new value type in C# language. This means Performance (no overhead like old Tuple, that stored a class instance) and new software design capabilities.
  • 23. Async return types C# 7.0 introduces ValueTask. The main advantage of this new struct, it’s to prevent the Allocation of a new Task<T> object in cases where the result of the async operation is already available at the time of awaiting.