C# 6

Exception filtering in C# 6.0

Those of you who read my previous post on What's new in C# 6.0 may have noticed that I forget to discuss an important feature of C# 6.0. Well that is exception filtering. I thought about updating the previous post with this feature explained but again felt that it deserves a post of its own. So let's start. Exception Filtering Exception filtering is nothing but some condition attached to the catch block. Execution of the catch block depends on this condition. Let me give you a simple example.…

Keep reading

What's New in C# 6.0

What's New In C# from Fiyaz Hasan on Vimeo. static types as using So, we are all quite familiar with this notion of accessing static class members using the qualification first. It is not required now. Importing static using can save the day. For example, before C# 6.0, we had to access ReadKey(), WriteLine() methods of the Console class by explicitely define the static class qualifier. using System; namespace NewInCSharp { class Program { static void Main(string[] args) { MySelf.WhoAmI(); Console.ReadKey(); } } static class MySelf { public static void…

Keep reading