SlideShare uma empresa Scribd logo
1 de 12
Auto Property Initialize
public class Person
{
public string First { get; set; } = "Jane";
public string Last { get; set; } = "Doe";
}
public class Person
{
public string First { get; } = "Jane";
public string Last { get; } = "Doe";
}
Read-Only Auto-Properties
Expression Bodied Method-Like Members
public Point Move(int dx, int dy) => new Point(x + dx, y + dy);
public static Complex operator +(Complex a, Complex b) => a.Add(b);
public static implicit operator string (Person p) => p.First + " " + p.Last;
C# 6.0 dan once
public Point Move(int dx, int dy)
{
return new Point(x + dx, y + dy);
}
public static Complex operator +(Complex a, Complex b)
{
return a.Add(b);
}
public static implicit operator string (Person p)
{
return p.First + " " + p.Last;
}
Expression Bodied Property-Like Function Members
public string Name => First + " " + Last;
public Person this[long id] => store.LookupPerson(id);
Extension Methods
using static System.Linq.Enumerable; // The type, not the namespace
class Program
{
static void Main()
{
var range = Range(5, 17); // Ok: not extension
var odd = Where(range, i => i % 2 == 1); // Error, not in scope
var even = range.Where(i => i % 2 == 0); // Ok
}
}
using static
using static BLL.ParameterBO;
GetAppParameter("EXCEL_MAX_RECORD_COUNT");
Null-Conditional Operator
int? length = people?.Length; // null if people is null
Person first = people?[0]; // null if people is null
6.0 dan önce
int? nullable = (people != null) ? new int?(people.Length) : null;
Person person = (people != null) ? people[0] : null;
int? first = people?[0]?.Orders.Count();
String Interpolation
6.0 dan önce
var s = string.Format("{0} is {1} year{{s}} old.", p.Name, p.Age);
var s = $"{p.Name} is {p.Age} year{{s}} old.";
var s = $"{p.Name,20} is {p.Age:D3} year{{s}} old.";
Formattable Strings
IFormattable christmas = $"{new DateTime(2015, 12, 25):f}";
var christamasText = christmas.ToString(null, new CultureInfo("pt-PT"));
When not otherwise specified, a formatting provider uses the current culture of the current thread
when invoking theString.Format method, but this is not always what is wanted. That is why, as
happens with lambda expressions, the compiler translates the interpolated string differently
depending on the type of receptor expression.
nameof
• Bir objeden objenin class ismini string olarak almak için kullanılır.
• System.ArgumentNullException
• PropertyChanged
Index Initializers
var numbers = new Dictionary<int, string>
{
[7] = "sete",
[9] = "nove",
[13] = "treze"
};
6.0 dan önce
var dictionary = new Dictionary<int, string>();
dictionary[7] = "sete";
dictionary[9] = "nove";
dictionary[13] = "treze";
var numbers = dictionary;
Exception Filters
try
{
...
}
catch (Exception ex) when (SomeFilter(ex))
{
...
try
{
//...
}
catch (SqlException ex) when (ex.Number == 2)
{
// ...
}
catch (SqlException ex)
{
// ...
}
'await' in 'catch' and 'finally' blocks
Resource res = null;
try
{
res = await Resource.OpenAsync();
}
catch (ResourceException e)
{
await Resource.LogAsync(res, e);
}
finally
{
if (res != null) await res.CloseAsync();
Teşekkürler
Hakkınızı Helal Edin!

Mais conteúdo relacionado

Mais procurados

Hash table and heaps
Hash table and heapsHash table and heaps
Hash table and heapsKatang Isip
 
MongoDB World 2016 : Advanced Aggregation
MongoDB World 2016 : Advanced AggregationMongoDB World 2016 : Advanced Aggregation
MongoDB World 2016 : Advanced AggregationJoe Drumgoole
 
Rdio's Alex Gaynor at Heroku's Waza 2013: Why Python, Ruby and Javascript are...
Rdio's Alex Gaynor at Heroku's Waza 2013: Why Python, Ruby and Javascript are...Rdio's Alex Gaynor at Heroku's Waza 2013: Why Python, Ruby and Javascript are...
Rdio's Alex Gaynor at Heroku's Waza 2013: Why Python, Ruby and Javascript are...Heroku
 
MongoDB Aggregation Framework
MongoDB Aggregation FrameworkMongoDB Aggregation Framework
MongoDB Aggregation FrameworkCaserta
 
The Ring programming language version 1.3 book - Part 31 of 88
The Ring programming language version 1.3 book - Part 31 of 88The Ring programming language version 1.3 book - Part 31 of 88
The Ring programming language version 1.3 book - Part 31 of 88Mahmoud Samir Fayed
 
Building apps why you should bet on the web
Building apps why you should bet on the webBuilding apps why you should bet on the web
Building apps why you should bet on the webthebeebs
 
Functional Programming
Functional ProgrammingFunctional Programming
Functional Programmingchriseidhof
 
Plot3D Package and Example in R.-Data visualizat,on
Plot3D Package and Example in R.-Data visualizat,onPlot3D Package and Example in R.-Data visualizat,on
Plot3D Package and Example in R.-Data visualizat,onDr. Volkan OBAN
 
La R Users Group Survey Of R Graphics
La R Users Group Survey Of R GraphicsLa R Users Group Survey Of R Graphics
La R Users Group Survey Of R Graphicsguest43ed8709
 
Print input-presentation
Print input-presentationPrint input-presentation
Print input-presentationMartin McBride
 
Python built in functions
Python built in functionsPython built in functions
Python built in functionsRakshitha S
 
Perl使いの国のRubyist
Perl使いの国のRubyistPerl使いの国のRubyist
Perl使いの国のRubyistTakafumi ONAKA
 
The Ring programming language version 1.5.3 book - Part 42 of 184
The Ring programming language version 1.5.3 book - Part 42 of 184The Ring programming language version 1.5.3 book - Part 42 of 184
The Ring programming language version 1.5.3 book - Part 42 of 184Mahmoud Samir Fayed
 
Human-powered Javascript Compression for Fun and Gummy Bears
Human-powered Javascript Compression for Fun and Gummy BearsHuman-powered Javascript Compression for Fun and Gummy Bears
Human-powered Javascript Compression for Fun and Gummy BearsRui Lopes
 
Julia meetup bangalore
Julia meetup bangaloreJulia meetup bangalore
Julia meetup bangaloreKrishna Kalyan
 
The Ring programming language version 1.9 book - Part 38 of 210
The Ring programming language version 1.9 book - Part 38 of 210The Ring programming language version 1.9 book - Part 38 of 210
The Ring programming language version 1.9 book - Part 38 of 210Mahmoud Samir Fayed
 

Mais procurados (19)

Master's Thesis
Master's ThesisMaster's Thesis
Master's Thesis
 
Hash table and heaps
Hash table and heapsHash table and heaps
Hash table and heaps
 
MongoDB World 2016 : Advanced Aggregation
MongoDB World 2016 : Advanced AggregationMongoDB World 2016 : Advanced Aggregation
MongoDB World 2016 : Advanced Aggregation
 
Metaprogramming
MetaprogrammingMetaprogramming
Metaprogramming
 
Rdio's Alex Gaynor at Heroku's Waza 2013: Why Python, Ruby and Javascript are...
Rdio's Alex Gaynor at Heroku's Waza 2013: Why Python, Ruby and Javascript are...Rdio's Alex Gaynor at Heroku's Waza 2013: Why Python, Ruby and Javascript are...
Rdio's Alex Gaynor at Heroku's Waza 2013: Why Python, Ruby and Javascript are...
 
MongoDB Aggregation Framework
MongoDB Aggregation FrameworkMongoDB Aggregation Framework
MongoDB Aggregation Framework
 
The Ring programming language version 1.3 book - Part 31 of 88
The Ring programming language version 1.3 book - Part 31 of 88The Ring programming language version 1.3 book - Part 31 of 88
The Ring programming language version 1.3 book - Part 31 of 88
 
Building apps why you should bet on the web
Building apps why you should bet on the webBuilding apps why you should bet on the web
Building apps why you should bet on the web
 
Functional Programming
Functional ProgrammingFunctional Programming
Functional Programming
 
Plot3D Package and Example in R.-Data visualizat,on
Plot3D Package and Example in R.-Data visualizat,onPlot3D Package and Example in R.-Data visualizat,on
Plot3D Package and Example in R.-Data visualizat,on
 
La R Users Group Survey Of R Graphics
La R Users Group Survey Of R GraphicsLa R Users Group Survey Of R Graphics
La R Users Group Survey Of R Graphics
 
Print input-presentation
Print input-presentationPrint input-presentation
Print input-presentation
 
Python built in functions
Python built in functionsPython built in functions
Python built in functions
 
Perl使いの国のRubyist
Perl使いの国のRubyistPerl使いの国のRubyist
Perl使いの国のRubyist
 
Cache and Drupal
Cache and DrupalCache and Drupal
Cache and Drupal
 
The Ring programming language version 1.5.3 book - Part 42 of 184
The Ring programming language version 1.5.3 book - Part 42 of 184The Ring programming language version 1.5.3 book - Part 42 of 184
The Ring programming language version 1.5.3 book - Part 42 of 184
 
Human-powered Javascript Compression for Fun and Gummy Bears
Human-powered Javascript Compression for Fun and Gummy BearsHuman-powered Javascript Compression for Fun and Gummy Bears
Human-powered Javascript Compression for Fun and Gummy Bears
 
Julia meetup bangalore
Julia meetup bangaloreJulia meetup bangalore
Julia meetup bangalore
 
The Ring programming language version 1.9 book - Part 38 of 210
The Ring programming language version 1.9 book - Part 38 of 210The Ring programming language version 1.9 book - Part 38 of 210
The Ring programming language version 1.9 book - Part 38 of 210
 

Destaque (16)

What's new in C# 6?
What's new in C# 6?What's new in C# 6?
What's new in C# 6?
 
Aleitamento materno2 (2) (1)
Aleitamento materno2 (2) (1)Aleitamento materno2 (2) (1)
Aleitamento materno2 (2) (1)
 
Guia ciclo menstrual
Guia ciclo menstrualGuia ciclo menstrual
Guia ciclo menstrual
 
metal textures
metal texturesmetal textures
metal textures
 
Maldivas
MaldivasMaldivas
Maldivas
 
Proyecto final liceo francisco g. billini(1)
Proyecto final  liceo francisco  g. billini(1)Proyecto final  liceo francisco  g. billini(1)
Proyecto final liceo francisco g. billini(1)
 
Diario de doble entrada
Diario de doble entradaDiario de doble entrada
Diario de doble entrada
 
Pedagogy
PedagogyPedagogy
Pedagogy
 
06
0606
06
 
Ciencias naturais 3
Ciencias naturais 3Ciencias naturais 3
Ciencias naturais 3
 
JavaScript 2016 for C# Developers
JavaScript 2016 for C# DevelopersJavaScript 2016 for C# Developers
JavaScript 2016 for C# Developers
 
"Prakritik Urja ka Manviya Vikas mein Yogdaan" ( Role of natural energy in Hu...
"Prakritik Urja ka Manviya Vikas mein Yogdaan" ( Role of natural energy in Hu..."Prakritik Urja ka Manviya Vikas mein Yogdaan" ( Role of natural energy in Hu...
"Prakritik Urja ka Manviya Vikas mein Yogdaan" ( Role of natural energy in Hu...
 
Тема №12 Електробезпека 2016 дистанц навчання-сайт-слайди
Тема №12 Електробезпека 2016 дистанц навчання-сайт-слайдиТема №12 Електробезпека 2016 дистанц навчання-сайт-слайди
Тема №12 Електробезпека 2016 дистанц навчання-сайт-слайди
 
Fume Extraction Systems by Team ABS Air Tech
Fume Extraction Systems by Team ABS Air TechFume Extraction Systems by Team ABS Air Tech
Fume Extraction Systems by Team ABS Air Tech
 
Jorge yimi ospina actividad 1.2 mapa conceptual
Jorge yimi ospina actividad 1.2 mapa conceptualJorge yimi ospina actividad 1.2 mapa conceptual
Jorge yimi ospina actividad 1.2 mapa conceptual
 
Programming in c#
Programming in c#Programming in c#
Programming in c#
 

Semelhante a C# 6.0

Tuga it 2016 - What's New In C# 6
Tuga it 2016 - What's New In C# 6Tuga it 2016 - What's New In C# 6
Tuga it 2016 - What's New In C# 6Paulo Morgado
 
From java to kotlin beyond alt+shift+cmd+k
From java to kotlin beyond alt+shift+cmd+kFrom java to kotlin beyond alt+shift+cmd+k
From java to kotlin beyond alt+shift+cmd+kFabio Collini
 
What's new in C# 6 - NetPonto Porto 20160116
What's new in C# 6  - NetPonto Porto 20160116What's new in C# 6  - NetPonto Porto 20160116
What's new in C# 6 - NetPonto Porto 20160116Paulo Morgado
 
Features of Kotlin I find exciting
Features of Kotlin I find excitingFeatures of Kotlin I find exciting
Features of Kotlin I find excitingRobert MacLean
 
Scala in a Java 8 World
Scala in a Java 8 WorldScala in a Java 8 World
Scala in a Java 8 WorldDaniel Blyth
 
Scala vs Java 8 in a Java 8 World
Scala vs Java 8 in a Java 8 WorldScala vs Java 8 in a Java 8 World
Scala vs Java 8 in a Java 8 WorldBTI360
 
4Developers 2015: Testowanie ze Spockiem - Dominik Przybysz
4Developers 2015: Testowanie ze Spockiem - Dominik Przybysz4Developers 2015: Testowanie ze Spockiem - Dominik Przybysz
4Developers 2015: Testowanie ze Spockiem - Dominik PrzybyszPROIDEA
 
This Is Not Your Father's Java
This Is Not Your Father's JavaThis Is Not Your Father's Java
This Is Not Your Father's JavaSven Efftinge
 
First few months with Kotlin - Introduction through android examples
First few months with Kotlin - Introduction through android examplesFirst few months with Kotlin - Introduction through android examples
First few months with Kotlin - Introduction through android examplesNebojša Vukšić
 
Linq And Its Impact On The.Net Framework
Linq And Its Impact On The.Net FrameworkLinq And Its Impact On The.Net Framework
Linq And Its Impact On The.Net Frameworkrushputin
 
Persisting Data on SQLite using Room
Persisting Data on SQLite using RoomPersisting Data on SQLite using Room
Persisting Data on SQLite using RoomNelson Glauber Leal
 
Kotlin for Android Developers - Victor Kropp - Codemotion Rome 2018
Kotlin for Android Developers - Victor Kropp - Codemotion Rome 2018Kotlin for Android Developers - Victor Kropp - Codemotion Rome 2018
Kotlin for Android Developers - Victor Kropp - Codemotion Rome 2018Codemotion
 
An Introduction to Scala (2014)
An Introduction to Scala (2014)An Introduction to Scala (2014)
An Introduction to Scala (2014)William Narmontas
 
Automatically Spotting Cross-language Relations
Automatically Spotting Cross-language RelationsAutomatically Spotting Cross-language Relations
Automatically Spotting Cross-language RelationsFederico Tomassetti
 
Что нам готовит грядущий C#7?
Что нам готовит грядущий C#7?Что нам готовит грядущий C#7?
Что нам готовит грядущий C#7?Andrey Akinshin
 
Scala - fra newbie til ninja på en time
Scala - fra newbie til ninja på en timeScala - fra newbie til ninja på en time
Scala - fra newbie til ninja på en timekarianneberg
 

Semelhante a C# 6.0 (20)

Tuga it 2016 - What's New In C# 6
Tuga it 2016 - What's New In C# 6Tuga it 2016 - What's New In C# 6
Tuga it 2016 - What's New In C# 6
 
From java to kotlin beyond alt+shift+cmd+k
From java to kotlin beyond alt+shift+cmd+kFrom java to kotlin beyond alt+shift+cmd+k
From java to kotlin beyond alt+shift+cmd+k
 
What's new in C# 6 - NetPonto Porto 20160116
What's new in C# 6  - NetPonto Porto 20160116What's new in C# 6  - NetPonto Porto 20160116
What's new in C# 6 - NetPonto Porto 20160116
 
Scala taxonomy
Scala taxonomyScala taxonomy
Scala taxonomy
 
Features of Kotlin I find exciting
Features of Kotlin I find excitingFeatures of Kotlin I find exciting
Features of Kotlin I find exciting
 
Scala in a Java 8 World
Scala in a Java 8 WorldScala in a Java 8 World
Scala in a Java 8 World
 
What's New In C# 7
What's New In C# 7What's New In C# 7
What's New In C# 7
 
Scala vs Java 8 in a Java 8 World
Scala vs Java 8 in a Java 8 WorldScala vs Java 8 in a Java 8 World
Scala vs Java 8 in a Java 8 World
 
4Developers 2015: Testowanie ze Spockiem - Dominik Przybysz
4Developers 2015: Testowanie ze Spockiem - Dominik Przybysz4Developers 2015: Testowanie ze Spockiem - Dominik Przybysz
4Developers 2015: Testowanie ze Spockiem - Dominik Przybysz
 
This Is Not Your Father's Java
This Is Not Your Father's JavaThis Is Not Your Father's Java
This Is Not Your Father's Java
 
C# 3.5 Features
C# 3.5 FeaturesC# 3.5 Features
C# 3.5 Features
 
First few months with Kotlin - Introduction through android examples
First few months with Kotlin - Introduction through android examplesFirst few months with Kotlin - Introduction through android examples
First few months with Kotlin - Introduction through android examples
 
Linq And Its Impact On The.Net Framework
Linq And Its Impact On The.Net FrameworkLinq And Its Impact On The.Net Framework
Linq And Its Impact On The.Net Framework
 
Persisting Data on SQLite using Room
Persisting Data on SQLite using RoomPersisting Data on SQLite using Room
Persisting Data on SQLite using Room
 
Kotlin for Android Developers - Victor Kropp - Codemotion Rome 2018
Kotlin for Android Developers - Victor Kropp - Codemotion Rome 2018Kotlin for Android Developers - Victor Kropp - Codemotion Rome 2018
Kotlin for Android Developers - Victor Kropp - Codemotion Rome 2018
 
An Introduction to Scala (2014)
An Introduction to Scala (2014)An Introduction to Scala (2014)
An Introduction to Scala (2014)
 
Automatically Spotting Cross-language Relations
Automatically Spotting Cross-language RelationsAutomatically Spotting Cross-language Relations
Automatically Spotting Cross-language Relations
 
Scala introduction
Scala introductionScala introduction
Scala introduction
 
Что нам готовит грядущий C#7?
Что нам готовит грядущий C#7?Что нам готовит грядущий C#7?
Что нам готовит грядущий C#7?
 
Scala - fra newbie til ninja på en time
Scala - fra newbie til ninja på en timeScala - fra newbie til ninja på en time
Scala - fra newbie til ninja på en time
 

Último

%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...masabamasaba
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 

Último (20)

%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 

C# 6.0

  • 1.
  • 2. Auto Property Initialize public class Person { public string First { get; set; } = "Jane"; public string Last { get; set; } = "Doe"; } public class Person { public string First { get; } = "Jane"; public string Last { get; } = "Doe"; } Read-Only Auto-Properties
  • 3. Expression Bodied Method-Like Members public Point Move(int dx, int dy) => new Point(x + dx, y + dy); public static Complex operator +(Complex a, Complex b) => a.Add(b); public static implicit operator string (Person p) => p.First + " " + p.Last; C# 6.0 dan once public Point Move(int dx, int dy) { return new Point(x + dx, y + dy); } public static Complex operator +(Complex a, Complex b) { return a.Add(b); } public static implicit operator string (Person p) { return p.First + " " + p.Last; }
  • 4. Expression Bodied Property-Like Function Members public string Name => First + " " + Last; public Person this[long id] => store.LookupPerson(id);
  • 5. Extension Methods using static System.Linq.Enumerable; // The type, not the namespace class Program { static void Main() { var range = Range(5, 17); // Ok: not extension var odd = Where(range, i => i % 2 == 1); // Error, not in scope var even = range.Where(i => i % 2 == 0); // Ok } } using static using static BLL.ParameterBO; GetAppParameter("EXCEL_MAX_RECORD_COUNT");
  • 6. Null-Conditional Operator int? length = people?.Length; // null if people is null Person first = people?[0]; // null if people is null 6.0 dan önce int? nullable = (people != null) ? new int?(people.Length) : null; Person person = (people != null) ? people[0] : null; int? first = people?[0]?.Orders.Count();
  • 7. String Interpolation 6.0 dan önce var s = string.Format("{0} is {1} year{{s}} old.", p.Name, p.Age); var s = $"{p.Name} is {p.Age} year{{s}} old."; var s = $"{p.Name,20} is {p.Age:D3} year{{s}} old."; Formattable Strings IFormattable christmas = $"{new DateTime(2015, 12, 25):f}"; var christamasText = christmas.ToString(null, new CultureInfo("pt-PT")); When not otherwise specified, a formatting provider uses the current culture of the current thread when invoking theString.Format method, but this is not always what is wanted. That is why, as happens with lambda expressions, the compiler translates the interpolated string differently depending on the type of receptor expression.
  • 8. nameof • Bir objeden objenin class ismini string olarak almak için kullanılır. • System.ArgumentNullException • PropertyChanged
  • 9. Index Initializers var numbers = new Dictionary<int, string> { [7] = "sete", [9] = "nove", [13] = "treze" }; 6.0 dan önce var dictionary = new Dictionary<int, string>(); dictionary[7] = "sete"; dictionary[9] = "nove"; dictionary[13] = "treze"; var numbers = dictionary;
  • 10. Exception Filters try { ... } catch (Exception ex) when (SomeFilter(ex)) { ... try { //... } catch (SqlException ex) when (ex.Number == 2) { // ... } catch (SqlException ex) { // ... }
  • 11. 'await' in 'catch' and 'finally' blocks Resource res = null; try { res = await Resource.OpenAsync(); } catch (ResourceException e) { await Resource.LogAsync(res, e); } finally { if (res != null) await res.CloseAsync();