Tag Archives: C#

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 »

Easily format strings – String interpolation in C# 6.0

By | November 26, 2014

Formatting the string values are very common during development. We generally use String.Format() method, that replaces each format item in a specified string with the text equivalent values from the objects. While this is a common, sometimes this is confusing and produce error. Because, we need to specific the place holder for each item and then map them… Read More »

Simplify Static Member Access – Using Statement With Static Classes in C# 6.0

By | November 25, 2014

C# 6.0 introduced many small and useful features that helps developers to write clean code. On of such feature is “Using Statement with Static Classes”. We know a static class cannot be instantiated. While using any static member, we find ourselves repeating the class name to access any of the static members. It looks kind of redundant which… Read More »