Category Archives: C# 6.0

Expression Bodied Local Function in C# 7.0

By | August 4, 2017

“Expression-bodied methods” were introduced with C# 6.0, that simplify the syntactic expression for methods in C#.  C# 7.0 extend this features for several new members including constructor, destructor, property assessors etc, and we have seen this one of our previous post – Expression – Bodied Members in C# 7.0. C# 7.0, also introduced local function by defining the helper… Read More »

How exception filters can help you investigate runtime errors in C#

By | July 2, 2016

Exception filters are not new. Its been there for a long time (at least for than a year) as it is been released with .NET framework 6.0. But I do see developers don’t know the basic advantages of using exception filters and use code inside catch to determine problems. Let us look how exception filters can help you… Read More »

Initialization of Dictionary – Dictionary initializer in C# 6.0

By | December 11, 2014

Initialization of Dictionary is not a new thing. You can easily initialize a Dictionary Object using a Collection Initializer, which is there since C# 3.0. Collection initializer adds one of the  parameter as Key and another as  Value corresponding to the assigned Key. C# 6.0 adds a new ability to use the Key / indexer to map with… Read More »

Null – Conditional Operators in C# 6.0

By | December 10, 2014

Along with the nameof operator, C# 6.0 also introduced Null-Conditional operator that enable developers to check the null value with in an object reference chain. The null –  conditional operator ( ?.) , returns null if anything in the object reference chain in null. This avoid checking null for each and every nested objects if they are all in… Read More »

Conditional Exception Handling – Exception Filters in C# 6.0

By | December 8, 2014

C# 6.0 has two changes for exception handling. In the previous post we have discussed about Using await in a catch or finally block – in C# 6.0 , and the another one is the filtering the exception. While Using await in a catch or finally block is a welcome change for developers, we can consider exception filter is… Read More »

Using await in a catch or finally block – in C# 6.0

By | December 6, 2014

Using Async methods are very common now a days and while working with  async and await,  you may have experienced that you want to put some of the result awaiting either in a catch or finally block or in both. Consider a scenario, when there is an exception  and you want to log information into file or sending a service call… Read More »