C# 6 is the last version of C#, implemented and available in VS 2015. Here are the main new features. Read more at https://github.com/dotnet/roslyn/wiki/New-Language-Features-in-C%23-6
2. Agenda
• New features
• Bonus
• Demo
• Conclusion
• Question Released July 20, 2015 with
.net 4.6, Roslyn, VS 2015
3. Auto-Property Initializers
You can initialize an auto-implemented
property inline. You no longer have to
declare a setter, providing a new way to
implement an immutable property
auto-implemented
properties were
introduced in C# 3.0.
4. Read-Only Auto-Properties
You no longer have to declare a setter for auto-implemented
properties. If no setter is declared, the property is immutable
everywhere except the type’s constructor
5. Null-Conditional Operator
If student is null, address will simply be
assigned null, and no NullReferenceExeception
will occur. This becomes more useful with
deeper object graphs.
6. Using Static Directives
Using static directives are a new kind of using directive which
brings static members of types directly into scope.
The intention of this feature is to improve code readability by
eliminating unnecessary and/or redundant type identifiers
7. String Interpolation
typically to concatenate strings you would either use
the “+” operator or composite formatting with a method
such as String.Format
With interpolated string expressions, you have a
string with contained expressions that are
replaced with the expressions’ results. You have to
prefix your string literal with a dollar sign ($)
8. nameof Expressions
Now with nameof expressions, you don’t have
to use string literals and the compiler will be
able to warn you if you are using an incorrect
name.
Some examples of where nameof expressions may be useful include:
• Throwing exceptions during parameter validation
• Passing an action name when setting up MVC action links
• Needing to pass the name of a property when firing a property changed event in
a class that implements INotifyPropertyChanged
• Passing the name of a property when registering a XAML dependency property
• Including a variable, type, or member name when logging
10. Expression Bodied Functions and Properties
You can now declare functions and properties as a lambda
expression, without the need for a statement block. Intended
for simple implementations, the new syntax is more concise in
that it eliminates the need for some of the curly braces and the
use of an explicit return statement.
11. Await in Catch and Finally Blocks
Ability to write asynchronous code
(use the await keyword) in catch and
finally blocks
12. Exception Filters
Now, through the use of the “when” keyword, we can
specify a condition for any catch block. Execution will
only drop into a catch block if the condition is satisfied.
This allows us to filter exceptions on things other than
just the exception type.
13. Conclusion
C# 6.0 isn’t a radical revolution in C# programming.
This version will change the way you write C# code
in specific scenarios. But Roslyn add new
possibilities in C# 7 is on track…
14. Bonus : Live code analysis (light bulbs)
The new Roslyn compiler for C# and Visual Basic not only provides faster compile
times—it also enables completely new scenarios such as live code analysis, which
provide rich and customizable feedback and suggestions directly inside the code
editor as you type
18. About Us
• Betclic Everest Group, one of the world leaders in online
gaming, has a unique portfolio comprising various
complementary international brands: Betclic, Everest
Poker/Casino, Bet-at-home, Expekt, Imperial Casino, Monte-
Carlo Casino…
• Through our brands, Betclic Everest Group places expertise,
technological know-how and security at the heart of our
strategy to deliver an on-line gaming offer attuned to the
passion of our players. We want our brands to be easy to use
for every gamer around the world. We’re building our
company to make that happen.
• Active in 100 countries with more than 12 million customers
worldwide, the Group is committed to promoting secure and
responsible gaming and is a member of several international
professional associations including the EGBA (European
Gaming and Betting Association) and the ESSA (European
Sports Security Association).
19. We want our Sports betting, Poker, Horse racing and
Casino & Games brands to be easy to use for every
gamer around the world. Code with us to make that
happen.
Look at all the challenges we offer HERE
Check our Employer Page
Follow us on LinkedIn
WE’RE HIRING !