Partitioner and Parallel Loops

Two common traps when using Parallel Loops could be summarized as following. *  The amount of work done in the loop is not significantly larger than the amount of time spend in synchronizing any shared states. *  Amount of work done is less than the cost of delegate or method invocation. Both of the problems … Continue reading Partitioner and Parallel Loops

SOLID : Liskov Substitution Principle (Part 2)

In the first part of the post, we visited the core definition of Liskov Substitution principle and took time to understand the problem using an example. In this second part, we would take time to understand some of the governing rules of the principle. The rules that needs to be followed for LSP compliance can … Continue reading SOLID : Liskov Substitution Principle (Part 2)

Conditional Serialization using NewtonSoft Json

One of the least explored feature of Newtonsoft Json is the ability serialize properties conditionally. Consider the hypothetical situation wherein you want to serialize a property in a class only if a condition is satisfied. For example, If the requirement is that you need to include serialize the Department Property only if the User Is … Continue reading Conditional Serialization using NewtonSoft Json