If you were to ask me what was the biggest milestone in .Net development, then my choice would definetly be .Net 5.0 - especially the introduction of the async/await. The more you learn about the underlying working, you cannot but stop and admire the efforts done by the lang uage developers to make our life easier. … Continue reading Asynchronous Code – Behind the Scenes – 001
Author: Anu Viswan
Revisiting Exception Handling in async methods
It is interesting to observe how the Exceptions behave in async code. While the .Net framework attempts to ensure the exprerience of handling failures in async methods are as similar to the synchronous methods, there are subtle differences which is worth understanding. Let us examine the following code. async Task<string> Foo() { var client = … Continue reading Revisiting Exception Handling in async methods
Dragging Shapes in Wpf
One of the projects I have in mind as my side-projects needs ability to drag-move shapes on a Canvas. I thought it would idea to explore the possibilities of achieving it via test projects first before starting the real one. So the goal of this article would be * Create a Rectangle in a Canvas … Continue reading Dragging Shapes in Wpf
C# 8 : Using Declaration
The next feature we would explore in C# 8 is more off a syntatic sugar, but neverthless it is important to understand the difference between the new syntax and the original feature it is covering up. We are all aware of the Using statements, which allows correct usage of the IDisposible objects. Using Statement Let … Continue reading C# 8 : Using Declaration
SOLID: Interface Segregation Principle
Completion of the series of articles on SOLID Principles has been due for a long time now. The lockdown due to Covid-19 has atleast given me more time to be able to work one some of the due items. In this part of the series we will seek to know more about the "I" of … Continue reading SOLID: Interface Segregation Principle
C# 8 : Index and Range
While C# as a language has grown leaps and bounds, one are that was least addressed was manipulation of collections (arrays in particular). C# 8 looks to change exactly that by introducing two new Types. System.Index System.Index is a structure that can be used to Index a collection either from the start or the end. … Continue reading C# 8 : Index and Range
Automapper – Use IoC for creating Destinations
Automapper by default creates new instances of destination using the default contructor. If you need to ask the IoC to create the new instance, it actually turns out to be pretty simple. We will begin by setting up our Unity Container to register the IMapper. As you can see, you are also initializing the Automapper … Continue reading Automapper – Use IoC for creating Destinations
Awaitable Pattern
How do you determine what types could be awaited ? That is one question that often comes to mind and the most common answer would be Task Task<TResult> void - Though it should be strictly avoided However, are we truely restricted to them ? What are the other Types that could be awaited ? The … Continue reading Awaitable Pattern
Member Serialization
Serialization at times throws curious situations that makes us look beyond the normal usages. Here is another situation that took sometime to find a solution for. Let's examine the following code. What would be the output if one was to serialize an instance of the Test class ? Let's examine the output Not surprising right … Continue reading Member Serialization
A second look at char.IsSymbol()
Let us begin by examining a rather simple looking code. What would the output of the above code ? Let's hit F5 and check it. Surprised ?? One should not feel guilty if he is surprised. It is rather surprising one does not look behind to understand what exactly char.IsSymbol does. After all, it is … Continue reading A second look at char.IsSymbol()