SlideShare a Scribd company logo
Deep Dive C# 8.0
Sabah Shariq | Microsoft MVP
C# Version History and Features
Version .NET Framework Visual Studio
C# 1.0 .NET Framework 1.0/1.1 Visual Studio .NET 2002
C# 2.0 .NET Framework 2.0 Visual Studio 2005
C# 3.0 .NET Framework 3.0/3.5 Visual Studio 2008
C# 4.0 .NET Framework 4.0 Visual Studio 2010
C# 5.0 .NET Framework 4.5 Visual Studio
2012/2013
C# 6.0 .NET Framework 4.6 Visual Studio
2013/2015
C# 7.0 .NET Core Visual Studio 2017
C# 8.0 .NET Core Visual Studio 2019
C# 8.0
Development Environment
1 .NET Core 3.0
2 Visual Studio 2019 (version 16.3)
Readonly Struct
• C# 7.X Struct set as readonly
• C# 8.0 Struct member set as readonly
C#7.X
C#8.0
Default interface methods
We know about Interfaces:
1 Only contains declarations of methods,
properties, indexers, and events
2
Interface cannot include private,
protected, or internal members
3 Interface cannot contain fields
4
By default, all the members are public. C#
will give a compile-time error if used
‘public’ keyword explicitly.
Default interface methods (cont.)
Default interface methods (cont.)
In C# 8.0 we can do following:
💡.NET Core 3.0 and C# 8.0
Switch expressions
Switch expressions (cont.)
=>
In C# 8.0
Switch expressions (cont.)
=>
• Variable comes before the switch keyword
• The case and : elements are replaced with =>
• default case is replaced with a _ discard
• bodies are expressions, not statements
Using declarations
C# 8.0 introduces Using declarations where we had Using statement
Static Local Function
Classic approach of single usage/call function:
Static Local Function (cont.)
Modern approach in C# 7.X In C# 8.0
Null-coalescing assignment
Old way
C#7.X: Null-coalescing
C#7.X: Null-coalescing assignment
Indices and ranges
• array[2]
• array[array.length-2]
• List().GetRange(2,3)
• The last word is {words[^1]}
• words[1..4]
• Start from end words[^2..^0]
Asynchronous streams
Nullable reference types
• C# is a strongly-typed language
• Declare the type of a variable
• Value type: integer, float, decimal, text, etc.
• Reference type: string, class, interface, object
Thank You

More Related Content

PDF
escape sequences and substitution markers
PDF
csharp repitition structures
PDF
History of C#
PPTX
DOCX
LAB 2 Report.docx
PDF
Functions
PDF
A simple program C# program
PDF
Session 5-exersice
escape sequences and substitution markers
csharp repitition structures
History of C#
LAB 2 Report.docx
Functions
A simple program C# program
Session 5-exersice

What's hot (19)

PDF
selection structures
PPTX
Interface and abstraction
DOCX
C language function
PPTX
Introduction of C#
PDF
Learn C# programming - Program Structure & Basic Syntax
PPT
Code Analysis-run time error prediction
PPTX
Fun with lambda expressions
DOCX
Exp 3-2 d422 (1)
PDF
OOPS With CSharp - Jinal Desai .NET
PPT
Cinfo
ODP
Ppt of c vs c#
PPTX
c# usage,applications and advantages
PPTX
Why system verilog ?
ODP
Ppt of c++ vs c#
PPTX
Evaluation of postfix expression
PPTX
Hello world! Intro to C++
PDF
DOCX
Programming Global variable
ODP
Objectivec vs swift
selection structures
Interface and abstraction
C language function
Introduction of C#
Learn C# programming - Program Structure & Basic Syntax
Code Analysis-run time error prediction
Fun with lambda expressions
Exp 3-2 d422 (1)
OOPS With CSharp - Jinal Desai .NET
Cinfo
Ppt of c vs c#
c# usage,applications and advantages
Why system verilog ?
Ppt of c++ vs c#
Evaluation of postfix expression
Hello world! Intro to C++
Programming Global variable
Objectivec vs swift
Ad

Similar to Deep Dive C# 8.0 (20)

PPTX
What's new in C# 8.0 (beta)
PDF
Whats Newi in C# 8.0
PDF
C# 7.x What's new and what's coming with C# 8
PDF
C# 8 in Libraries and Applications - BASTA! Frankfurt 2020
PPTX
Evolution of c# - by K.Jegan
DOCX
csharp.docx
PDF
C# 8 in Libraries and Applications
PPTX
What's New in C# ? C# 6, 7.0, 7.1 and 7.2
PPTX
C#: Past, Present and Future
PPTX
What's coming to c# (Tel-Aviv, 2018)
PDF
C# - What's Next?
PPTX
C# 6.0 and 7.0 new features
PPTX
Mini .net conf 2020
PDF
2.Getting Started with C#.Net-(C#)
PDF
C# in Depth-Manning Publications (2019).pdf
PDF
C# 8 and .NET Core 3
PPTX
What’s new in .NET
ODP
C# 3.0 Course
PPTX
Recapping C# 6.0 and A First Look Into C# 7.0
PPTX
C# 7.0, 7.1, 7.2
What's new in C# 8.0 (beta)
Whats Newi in C# 8.0
C# 7.x What's new and what's coming with C# 8
C# 8 in Libraries and Applications - BASTA! Frankfurt 2020
Evolution of c# - by K.Jegan
csharp.docx
C# 8 in Libraries and Applications
What's New in C# ? C# 6, 7.0, 7.1 and 7.2
C#: Past, Present and Future
What's coming to c# (Tel-Aviv, 2018)
C# - What's Next?
C# 6.0 and 7.0 new features
Mini .net conf 2020
2.Getting Started with C#.Net-(C#)
C# in Depth-Manning Publications (2019).pdf
C# 8 and .NET Core 3
What’s new in .NET
C# 3.0 Course
Recapping C# 6.0 and A First Look Into C# 7.0
C# 7.0, 7.1, 7.2
Ad

Recently uploaded (20)

PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Empathic Computing: Creating Shared Understanding
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Electronic commerce courselecture one. Pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Getting Started with Data Integration: FME Form 101
PPT
Teaching material agriculture food technology
PPTX
1. Introduction to Computer Programming.pptx
PPTX
Big Data Technologies - Introduction.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Empathic Computing: Creating Shared Understanding
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Mobile App Security Testing_ A Comprehensive Guide.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
The Rise and Fall of 3GPP – Time for a Sabbatical?
MYSQL Presentation for SQL database connectivity
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
MIND Revenue Release Quarter 2 2025 Press Release
Electronic commerce courselecture one. Pdf
20250228 LYD VKU AI Blended-Learning.pptx
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Dropbox Q2 2025 Financial Results & Investor Presentation
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Machine learning based COVID-19 study performance prediction
Getting Started with Data Integration: FME Form 101
Teaching material agriculture food technology
1. Introduction to Computer Programming.pptx
Big Data Technologies - Introduction.pptx

Deep Dive C# 8.0

Editor's Notes

  • #3: Word cloud image source: Filip Ekberg blog.