Replace If with Polymorphism with AutoFac DI Container


As the title specifies we will be Replacing the conditional if and Switch statement with the help of Polymorphism using DI container and talk about the benefits of doing the same in this article. Oops gives us pretty much great features which we are aware of theoretically but never implements practically. Polymorphism is one of the main features provided by Object-Oriented Languages which in turn implies that a Parent class can have more than one behavior and can point towards its child classes at runtime. If you want to learn more about OOPS features, you can go through below blog which talks about oops and other features. Continue reading

Adding an Existing Visual Studio Project to Bit bucket

Hi Everyone, I have developed many utilities to automate things up for us in my local machines and I have lost a lot of them. We as a developer usually code develop our own utilities to increase our productivity and use our artistic mind and practice a lot of code in home, office, workshops etc.
We generally keep our repository in our local machines. But sometimes due to system failure, we lose our best works which no1 is aware or project you were working on. Usually, big organization uses a Source Control system to avoid this vandalism like SVN, TFS, Bit Bucket, GitHub etc. With the advent of GitHub and Bit bucket, it’s is easy for developers to keep his magic work to be saved in the cloud that to private to him. Continue reading

Choose and IIF Function in Sql Server

Choose function in SQL Server is used to get the item at the specified index from the list of available values. The index position starts with 1.


Select choose(index,value1,value2,..)


If the mentioned index is greater or less than the specified values, It results null.


If we pass the float value in the index it will be converted to an integer, based on that the value will be selected.


IIF Function

If function returns the one of the two values, depending on the condition evaluates true or false.



The IIF function is like Ternary operator in a programming language with single condition.