SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Let's Explore C# 6
Jaliya Udagedara
MVP (Visual C#)
.NET Framework
version
CLR version Released Year Visual Studio
version
C# Version
1.0 1.0 2002 Visual Studio .NET 1.0
1.1 1.1 2003 2003 1.2
2.0 2.0 2005 2005 2.0
3.0 2.0 2006 2005 2.0
3.5 2.0 2008 2008 3.0
4 4.0 2010 2010 4.0
4.5 4.0 2012 2012 5.0
4.5.1 4.0 2013 2013 5.0
4.5.2 4.0 2013 2013 5.0
4.6 Preview 4.0 2014 2015 Preview 6.0 Preview
C# 2.0 C# 3.0 C# 4.0 C# 5.0
Generics Implicitly typed variables
(var)
Named and optional
arguments
Async/Await
Partial Classes Object and collection
initializers
Dynamic Caller information
Static Classes Auto properties Covariance and
Contravariance in
Generics
Iterators Partial Methods
Anonymous Methods Extension Methods
Property Accessor
Accessibility
Lambda Expressions
LINQ
using System.Console;
class Program
{
static void Main(string[] args)
{
WriteLine("Hello C# 6.0");
}
}
public string FirstName { get; set; } = "Jaliya";
public string LastName { get; set; } = "Udagedara";
public string LastName { get; } = "Udagedara";
public DateTime DateOfBirth { get; set; }
public int Age => DateTime.Now.Year - DateOfBirth.Year;
public override string ToString() =>
string.Format("{0} {1}", FirstName, LastName);
public override string ToString() => "{FirstName} {LastName}";
public static Dictionary<int, Employee> GetEmployees()
{
return new Dictionary<int, Employee>()
{
[0] = new Employee() { FirstName = "Jaliya" },
[1] = new Employee() { FirstName = "John" },
[2] = new Employee() { FirstName = "Jane" }
};
}
try
{
}
catch (Exception ex) if (ex is NullReferenceException)
{
throw;
}
catch (Exception ex)
{
}
try
{
List<Employee> employees = null;
//some operation on null employees
}
catch (Exception ex) if (ex is NullReferenceException)
{
throw new NullReferenceException(nameof(employees));
}
catch (Exception ex)
{
}
WriteLine(employees?.Count);
try
{
int i = 0; Console.WriteLine(10 / i);
}
catch (Exception)
{
await LogAsync();
}
finally
{
await LogAsync();
}
struct Employee
{
public string FirstName { get; set; }
public string LastName { get; set; }
public Employee() : this("Jaliya", "Udagedara")
{
}
public Employee(string firstName, string lastName)
{
this.FirstName = firstName;
this.LastName = lastName;
}
}
• C# 6
Thank You!
http://www.jaliyaudagedara.blogspot.com/

Weitere ähnliche Inhalte

Was ist angesagt?

Code Review: How and When
Code Review: How and WhenCode Review: How and When
Code Review: How and WhenPaul Gower
 
Code review guidelines
Code review guidelinesCode review guidelines
Code review guidelinesLalit Kale
 
Code-Review-Principles-Process-and-Tools (1)
Code-Review-Principles-Process-and-Tools (1)Code-Review-Principles-Process-and-Tools (1)
Code-Review-Principles-Process-and-Tools (1)Aditya Bhuyan
 
Code Review tool for personal effectiveness and waste analysis
Code Review tool for personal effectiveness and waste analysisCode Review tool for personal effectiveness and waste analysis
Code Review tool for personal effectiveness and waste analysisMikalai Alimenkou
 
FluentSelenium Presentation Code Camp09
FluentSelenium Presentation Code Camp09FluentSelenium Presentation Code Camp09
FluentSelenium Presentation Code Camp09Pyxis Technologies
 
Testing the untestable
Testing the untestableTesting the untestable
Testing the untestableRoyKlein
 
Alexandru Bolboaca - Unit Testing from the Trenches
Alexandru Bolboaca - Unit Testing from the TrenchesAlexandru Bolboaca - Unit Testing from the Trenches
Alexandru Bolboaca - Unit Testing from the TrenchesMozaic Works
 
Software Analysis using Natural Language Queries
Software Analysis using Natural Language QueriesSoftware Analysis using Natural Language Queries
Software Analysis using Natural Language QueriesPooja Rani
 
Code Review
Code ReviewCode Review
Code ReviewRavi Raj
 
Let linguistics guide software analysis
Let linguistics guide software analysisLet linguistics guide software analysis
Let linguistics guide software analysisPooja Rani
 
Improving Code Quality Through Effective Review Process
Improving Code Quality Through Effective  Review ProcessImproving Code Quality Through Effective  Review Process
Improving Code Quality Through Effective Review ProcessDr. Syed Hassan Amin
 
Robot framework - SAST Väst Q3
Robot framework - SAST Väst Q3Robot framework - SAST Väst Q3
Robot framework - SAST Väst Q3Anders Arnholm
 
Code Review Tool Evaluation
Code Review Tool EvaluationCode Review Tool Evaluation
Code Review Tool EvaluationKate Semizhon
 
Code Review
Code ReviewCode Review
Code ReviewDivante
 
Be armed to the teeth to maintain a high quality iOS code
Be armed to the teeth to maintain a high quality iOS codeBe armed to the teeth to maintain a high quality iOS code
Be armed to the teeth to maintain a high quality iOS codeAnastasia Kazakova
 
Importance of the quality of code
Importance of the quality of codeImportance of the quality of code
Importance of the quality of codeShwe Yee
 

Was ist angesagt? (20)

Code Review for iOS
Code Review for iOSCode Review for iOS
Code Review for iOS
 
Code Review: How and When
Code Review: How and WhenCode Review: How and When
Code Review: How and When
 
Code Review
Code ReviewCode Review
Code Review
 
Code review guidelines
Code review guidelinesCode review guidelines
Code review guidelines
 
Code-Review-Principles-Process-and-Tools (1)
Code-Review-Principles-Process-and-Tools (1)Code-Review-Principles-Process-and-Tools (1)
Code-Review-Principles-Process-and-Tools (1)
 
Code Review tool for personal effectiveness and waste analysis
Code Review tool for personal effectiveness and waste analysisCode Review tool for personal effectiveness and waste analysis
Code Review tool for personal effectiveness and waste analysis
 
Code Review
Code ReviewCode Review
Code Review
 
FluentSelenium Presentation Code Camp09
FluentSelenium Presentation Code Camp09FluentSelenium Presentation Code Camp09
FluentSelenium Presentation Code Camp09
 
Testing the untestable
Testing the untestableTesting the untestable
Testing the untestable
 
Alexandru Bolboaca - Unit Testing from the Trenches
Alexandru Bolboaca - Unit Testing from the TrenchesAlexandru Bolboaca - Unit Testing from the Trenches
Alexandru Bolboaca - Unit Testing from the Trenches
 
Software Analysis using Natural Language Queries
Software Analysis using Natural Language QueriesSoftware Analysis using Natural Language Queries
Software Analysis using Natural Language Queries
 
Code Review
Code ReviewCode Review
Code Review
 
Let linguistics guide software analysis
Let linguistics guide software analysisLet linguistics guide software analysis
Let linguistics guide software analysis
 
Improving Code Quality Through Effective Review Process
Improving Code Quality Through Effective  Review ProcessImproving Code Quality Through Effective  Review Process
Improving Code Quality Through Effective Review Process
 
Robot framework - SAST Väst Q3
Robot framework - SAST Väst Q3Robot framework - SAST Väst Q3
Robot framework - SAST Väst Q3
 
Code Review Tool Evaluation
Code Review Tool EvaluationCode Review Tool Evaluation
Code Review Tool Evaluation
 
Code Review
Code ReviewCode Review
Code Review
 
AspectMock
AspectMockAspectMock
AspectMock
 
Be armed to the teeth to maintain a high quality iOS code
Be armed to the teeth to maintain a high quality iOS codeBe armed to the teeth to maintain a high quality iOS code
Be armed to the teeth to maintain a high quality iOS code
 
Importance of the quality of code
Importance of the quality of codeImportance of the quality of code
Importance of the quality of code
 

Andere mochten auch

Building Universal Apps for Windows and Windows Phone
Building Universal Apps for Windows and Windows PhoneBuilding Universal Apps for Windows and Windows Phone
Building Universal Apps for Windows and Windows PhoneJaliya Udagedara
 
Getting Started Developing Universal Windows Platform (UWP) Apps
Getting Started Developing Universal Windows Platform (UWP) AppsGetting Started Developing Universal Windows Platform (UWP) Apps
Getting Started Developing Universal Windows Platform (UWP) AppsJaliya Udagedara
 
Introduction to Universal Apps
Introduction to Universal AppsIntroduction to Universal Apps
Introduction to Universal AppsJaliya Udagedara
 
Introduction to Universal Apps-Jaliya Udagedara
Introduction to Universal Apps-Jaliya UdagedaraIntroduction to Universal Apps-Jaliya Udagedara
Introduction to Universal Apps-Jaliya UdagedaraJaliya Udagedara
 
Universal Apps for Windows Devices
Universal Apps for Windows DevicesUniversal Apps for Windows Devices
Universal Apps for Windows DevicesJaliya Udagedara
 
Windows communication foundation (part1) jaliya udagedara
Windows communication foundation (part1)    jaliya udagedaraWindows communication foundation (part1)    jaliya udagedara
Windows communication foundation (part1) jaliya udagedaraJaliya Udagedara
 
Windows communication foundation (part2) jaliya udagedara
Windows communication foundation (part2) jaliya udagedaraWindows communication foundation (part2) jaliya udagedara
Windows communication foundation (part2) jaliya udagedaraJaliya Udagedara
 
Windows Phone Application Development
Windows Phone Application DevelopmentWindows Phone Application Development
Windows Phone Application DevelopmentJaliya Udagedara
 
Lambda Expressions in C# From Beginner To Expert - Jaliya Udagedara
Lambda Expressions in C# From Beginner To Expert - Jaliya UdagedaraLambda Expressions in C# From Beginner To Expert - Jaliya Udagedara
Lambda Expressions in C# From Beginner To Expert - Jaliya UdagedaraJaliya Udagedara
 
Universal Apps for Windows Devices
Universal Apps for Windows DevicesUniversal Apps for Windows Devices
Universal Apps for Windows DevicesJaliya Udagedara
 
Mobile UI Lecture by Luis Salinas
Mobile UI Lecture by Luis Salinas Mobile UI Lecture by Luis Salinas
Mobile UI Lecture by Luis Salinas Luis Salinas
 
Design In Tech Report 2016
Design In Tech Report 2016Design In Tech Report 2016
Design In Tech Report 2016John Maeda
 
Design in Tech Report 2017
Design in Tech Report 2017Design in Tech Report 2017
Design in Tech Report 2017John Maeda
 

Andere mochten auch (16)

Windows Runtime Apps
Windows Runtime AppsWindows Runtime Apps
Windows Runtime Apps
 
Building Universal Apps for Windows and Windows Phone
Building Universal Apps for Windows and Windows PhoneBuilding Universal Apps for Windows and Windows Phone
Building Universal Apps for Windows and Windows Phone
 
Getting Started Developing Universal Windows Platform (UWP) Apps
Getting Started Developing Universal Windows Platform (UWP) AppsGetting Started Developing Universal Windows Platform (UWP) Apps
Getting Started Developing Universal Windows Platform (UWP) Apps
 
Introduction to Universal Apps
Introduction to Universal AppsIntroduction to Universal Apps
Introduction to Universal Apps
 
Introduction to Universal Apps-Jaliya Udagedara
Introduction to Universal Apps-Jaliya UdagedaraIntroduction to Universal Apps-Jaliya Udagedara
Introduction to Universal Apps-Jaliya Udagedara
 
Windows Runtime Apps
Windows Runtime AppsWindows Runtime Apps
Windows Runtime Apps
 
Universal Apps for Windows Devices
Universal Apps for Windows DevicesUniversal Apps for Windows Devices
Universal Apps for Windows Devices
 
Windows communication foundation (part1) jaliya udagedara
Windows communication foundation (part1)    jaliya udagedaraWindows communication foundation (part1)    jaliya udagedara
Windows communication foundation (part1) jaliya udagedara
 
Windows communication foundation (part2) jaliya udagedara
Windows communication foundation (part2) jaliya udagedaraWindows communication foundation (part2) jaliya udagedara
Windows communication foundation (part2) jaliya udagedara
 
Windows Phone Application Development
Windows Phone Application DevelopmentWindows Phone Application Development
Windows Phone Application Development
 
Lambda Expressions in C# From Beginner To Expert - Jaliya Udagedara
Lambda Expressions in C# From Beginner To Expert - Jaliya UdagedaraLambda Expressions in C# From Beginner To Expert - Jaliya Udagedara
Lambda Expressions in C# From Beginner To Expert - Jaliya Udagedara
 
Generics In and Out
Generics In and OutGenerics In and Out
Generics In and Out
 
Universal Apps for Windows Devices
Universal Apps for Windows DevicesUniversal Apps for Windows Devices
Universal Apps for Windows Devices
 
Mobile UI Lecture by Luis Salinas
Mobile UI Lecture by Luis Salinas Mobile UI Lecture by Luis Salinas
Mobile UI Lecture by Luis Salinas
 
Design In Tech Report 2016
Design In Tech Report 2016Design In Tech Report 2016
Design In Tech Report 2016
 
Design in Tech Report 2017
Design in Tech Report 2017Design in Tech Report 2017
Design in Tech Report 2017
 

Ähnlich wie Let's Explore C# 6

C# 2 to 5 short Introduction
C# 2 to 5 short IntroductionC# 2 to 5 short Introduction
C# 2 to 5 short IntroductionChen-Tien Tsai
 
.NET Profilers and IL Rewriting - DDD Melbourne 2
.NET Profilers and IL Rewriting - DDD Melbourne 2.NET Profilers and IL Rewriting - DDD Melbourne 2
.NET Profilers and IL Rewriting - DDD Melbourne 2Shaun Wilde
 
Net framework
Net frameworkNet framework
Net frameworkTuan Ngo
 
.NET Fundamentals and Business Application Development
.NET Fundamentals and Business Application Development.NET Fundamentals and Business Application Development
.NET Fundamentals and Business Application Development명신 김
 
selenium automation software testing course syllabus TheKiranAcademy_compress...
selenium automation software testing course syllabus TheKiranAcademy_compress...selenium automation software testing course syllabus TheKiranAcademy_compress...
selenium automation software testing course syllabus TheKiranAcademy_compress...akashjbk7
 
.NET and C# introduction
.NET and C# introduction.NET and C# introduction
.NET and C# introductionPeter Gfader
 
Core Java Certification
Core Java CertificationCore Java Certification
Core Java CertificationVskills
 
MICROSOFT C#.NET ONLINE TRAINING
MICROSOFT C#.NET ONLINE TRAININGMICROSOFT C#.NET ONLINE TRAINING
MICROSOFT C#.NET ONLINE TRAININGSanthosh Sap
 
Microsoft c#.net online training.ppsx
Microsoft c#.net online training.ppsxMicrosoft c#.net online training.ppsx
Microsoft c#.net online training.ppsxSanthosh Reddy
 
Certified Core Java Developer
Certified Core Java DeveloperCertified Core Java Developer
Certified Core Java DeveloperNarender Rana
 
Entity Framework 4 In Microsoft Visual Studio 2010 - ericnel
Entity Framework 4 In Microsoft Visual Studio 2010 - ericnelEntity Framework 4 In Microsoft Visual Studio 2010 - ericnel
Entity Framework 4 In Microsoft Visual Studio 2010 - ericnelukdpe
 
csharp_dotnet_adnanreza.pptx
csharp_dotnet_adnanreza.pptxcsharp_dotnet_adnanreza.pptx
csharp_dotnet_adnanreza.pptxPoornima E.G.
 
Concepts of Asp.Net
Concepts of Asp.NetConcepts of Asp.Net
Concepts of Asp.Netvidyamittal
 
Azure Integration DTAP Series, How to go from Development to Production – Par...
Azure Integration DTAP Series, How to go from Development to Production – Par...Azure Integration DTAP Series, How to go from Development to Production – Par...
Azure Integration DTAP Series, How to go from Development to Production – Par...BizTalk360
 
C# Interview Questions | Edureka
C# Interview Questions | EdurekaC# Interview Questions | Edureka
C# Interview Questions | EdurekaEdureka!
 
Azure Integration DTAP Series, How to go from Development to Production – Par...
Azure Integration DTAP Series, How to go from Development to Production – Par...Azure Integration DTAP Series, How to go from Development to Production – Par...
Azure Integration DTAP Series, How to go from Development to Production – Par...BizTalk360
 

Ähnlich wie Let's Explore C# 6 (20)

C# 2 to 5 short Introduction
C# 2 to 5 short IntroductionC# 2 to 5 short Introduction
C# 2 to 5 short Introduction
 
.NET Profilers and IL Rewriting - DDD Melbourne 2
.NET Profilers and IL Rewriting - DDD Melbourne 2.NET Profilers and IL Rewriting - DDD Melbourne 2
.NET Profilers and IL Rewriting - DDD Melbourne 2
 
Deep Dive C# 8.0
Deep Dive C# 8.0Deep Dive C# 8.0
Deep Dive C# 8.0
 
Net framework
Net frameworkNet framework
Net framework
 
.NET Fundamentals and Business Application Development
.NET Fundamentals and Business Application Development.NET Fundamentals and Business Application Development
.NET Fundamentals and Business Application Development
 
selenium automation software testing course syllabus TheKiranAcademy_compress...
selenium automation software testing course syllabus TheKiranAcademy_compress...selenium automation software testing course syllabus TheKiranAcademy_compress...
selenium automation software testing course syllabus TheKiranAcademy_compress...
 
csharp.docx
csharp.docxcsharp.docx
csharp.docx
 
.NET and C# introduction
.NET and C# introduction.NET and C# introduction
.NET and C# introduction
 
Core Java Certification
Core Java CertificationCore Java Certification
Core Java Certification
 
MICROSOFT C#.NET ONLINE TRAINING
MICROSOFT C#.NET ONLINE TRAININGMICROSOFT C#.NET ONLINE TRAINING
MICROSOFT C#.NET ONLINE TRAINING
 
Microsoft c#.net online training.ppsx
Microsoft c#.net online training.ppsxMicrosoft c#.net online training.ppsx
Microsoft c#.net online training.ppsx
 
Certified Core Java Developer
Certified Core Java DeveloperCertified Core Java Developer
Certified Core Java Developer
 
C sharp
C sharpC sharp
C sharp
 
Entity Framework 4 In Microsoft Visual Studio 2010 - ericnel
Entity Framework 4 In Microsoft Visual Studio 2010 - ericnelEntity Framework 4 In Microsoft Visual Studio 2010 - ericnel
Entity Framework 4 In Microsoft Visual Studio 2010 - ericnel
 
csharp_dotnet_adnanreza.pptx
csharp_dotnet_adnanreza.pptxcsharp_dotnet_adnanreza.pptx
csharp_dotnet_adnanreza.pptx
 
Concepts of Asp.Net
Concepts of Asp.NetConcepts of Asp.Net
Concepts of Asp.Net
 
Azure Integration DTAP Series, How to go from Development to Production – Par...
Azure Integration DTAP Series, How to go from Development to Production – Par...Azure Integration DTAP Series, How to go from Development to Production – Par...
Azure Integration DTAP Series, How to go from Development to Production – Par...
 
C# Interview Questions | Edureka
C# Interview Questions | EdurekaC# Interview Questions | Edureka
C# Interview Questions | Edureka
 
Azure Integration DTAP Series, How to go from Development to Production – Par...
Azure Integration DTAP Series, How to go from Development to Production – Par...Azure Integration DTAP Series, How to go from Development to Production – Par...
Azure Integration DTAP Series, How to go from Development to Production – Par...
 
Cs30 New
Cs30 NewCs30 New
Cs30 New
 

Kürzlich hochgeladen

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.
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
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
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 

Kürzlich hochgeladen (20)

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
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
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...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 

Let's Explore C# 6

  • 1. Let's Explore C# 6 Jaliya Udagedara MVP (Visual C#)
  • 2.
  • 3. .NET Framework version CLR version Released Year Visual Studio version C# Version 1.0 1.0 2002 Visual Studio .NET 1.0 1.1 1.1 2003 2003 1.2 2.0 2.0 2005 2005 2.0 3.0 2.0 2006 2005 2.0 3.5 2.0 2008 2008 3.0 4 4.0 2010 2010 4.0 4.5 4.0 2012 2012 5.0 4.5.1 4.0 2013 2013 5.0 4.5.2 4.0 2013 2013 5.0 4.6 Preview 4.0 2014 2015 Preview 6.0 Preview
  • 4. C# 2.0 C# 3.0 C# 4.0 C# 5.0 Generics Implicitly typed variables (var) Named and optional arguments Async/Await Partial Classes Object and collection initializers Dynamic Caller information Static Classes Auto properties Covariance and Contravariance in Generics Iterators Partial Methods Anonymous Methods Extension Methods Property Accessor Accessibility Lambda Expressions LINQ
  • 5.
  • 6.
  • 7.
  • 8. using System.Console; class Program { static void Main(string[] args) { WriteLine("Hello C# 6.0"); } }
  • 9. public string FirstName { get; set; } = "Jaliya"; public string LastName { get; set; } = "Udagedara"; public string LastName { get; } = "Udagedara";
  • 10. public DateTime DateOfBirth { get; set; } public int Age => DateTime.Now.Year - DateOfBirth.Year; public override string ToString() => string.Format("{0} {1}", FirstName, LastName);
  • 11. public override string ToString() => "{FirstName} {LastName}";
  • 12. public static Dictionary<int, Employee> GetEmployees() { return new Dictionary<int, Employee>() { [0] = new Employee() { FirstName = "Jaliya" }, [1] = new Employee() { FirstName = "John" }, [2] = new Employee() { FirstName = "Jane" } }; }
  • 13. try { } catch (Exception ex) if (ex is NullReferenceException) { throw; } catch (Exception ex) { }
  • 14. try { List<Employee> employees = null; //some operation on null employees } catch (Exception ex) if (ex is NullReferenceException) { throw new NullReferenceException(nameof(employees)); } catch (Exception ex) { }
  • 16. try { int i = 0; Console.WriteLine(10 / i); } catch (Exception) { await LogAsync(); } finally { await LogAsync(); }
  • 17. struct Employee { public string FirstName { get; set; } public string LastName { get; set; } public Employee() : this("Jaliya", "Udagedara") { } public Employee(string firstName, string lastName) { this.FirstName = firstName; this.LastName = lastName; } }

Hinweis der Redaktion

  1. C# 2.0 Generics Partial Classes C# 3.0 Implicitly typed variables (var) Object and collection initializers Auto properties Partial Methods Extension Methods Lambda Expressions LINQ C# 4.0 Named and optional arguments Dynamic Covariance and Contravariance C# 5.0 Async/Await Caller information
  2. Covariance Enables you to use a more specific type than originally specified. Ex:  IEnumerable<object> = IEnumerable<string> Contravariance Enables you to use a more generic (less derived) type than originally specified. Ex:  IEnumerable<string> = IEnumerable<object>
  3. Visual Studio Community 2013 Includes all the great functionality of Visual Studio Professional 2013 Terms Any individual developer can use Visual Studio Community to create their own free or paid apps Organization can use for the following scenarios: In a classroom learning environment Academic research Contributing to open source projects .NET Open Source and Cross-Platform ASP.NET and the C# compiler is already open sourced