Good Morning C# Enthusiasts:
Interested in C# 6.0? Well, Bill Wagner, author of "Effective C#: 50 Specific Ways to Improve Your C#, 2nd Ed" has put together a great free learning article covering just that.
Article Title: A Brief Tour of C# 6.0
Content Sample: Improvements to Existing Features
"I'll begin with a feature many developers thought C# already supported: using the await keyword in a catch or finally clause. Developers might have thought this feature was already supported because the await expression had so few restrictions on where it can be used."
"The C# language team did quite a bit of work in C# 5.0 trying to make async and await work seamlessly with all the remaining features in the C# language. That was a laudable goal, but the reality is that introducing an await expression in a catch or finally clause is very hard on the compiler. The language designers always wanted this feature; it just didn't make the time schedules for C# 5.0. Now, with the new C# 6.0 codebase, the team prioritized this addition to the async and await features. For example, examine this code snippet:"
private async static Task RunAsyncTest()
catch (Exception e)
"This method will return a task. If an exception is thrown from DoWebbyThings(), the method returns a task that will eventually return a faulted task. Faulted tasks contain an aggregate exception that contains any exceptions generated during the execution of the task. If the GenerateLog message completes correctly, the AggregateException contains a single exception: the exception thrown by DoWebbyThings(). However, if GenerateLog() throws an exception, the AggregateException still contains a single exception: the exception thrown by GenerateLog()."
"The behavior I've just described is how this works for an await in either a catch or a finally clause. This feature may not change your daily coding experiences very much, but it means that C# more naturally supports async programming in more situations and scenarios. The behavior is consistent with how task objects are processed in other areas of your code."
"Another changed feature is using static members. This is an extension to the using statements that import definitions into the current (or global) namespace. Every C# developer is familiar with the classic using statements:"
"Now you can limit the scope of a using statement to a single static class:"
"Notice that the syntax highlighting shows that System.Math is a class, not a namespace. This new variation of the using statement enables you to reference members of a static class (such as Math) simply by their names:"
var answer = Sqrt(3 * 3 + 4 * 4);
Enjoy the content all. #CSharp #CSharpProgramming #CSharp6 #CSharpTutorial +C# Corner +C# Tutorial +c# Libaray +Programming.com