Category: CSharp
-
Decorator Pattern in C#
Read full article on Falafel blog “Decorator pattern attach additional functionalities or responsibilities to an existing object at the runtime”. It adds new behaviour to an individual object without affecting other objects of the same class. New behaviour or functionalities can be either added dynamically at the run time or statically. The decorator pattern: ·…
-
Using AutoMapper : Getting Started
Read full article on Falafel blog I have often seen developers use the LINQ SELECT statement to create a new instance of one class from an existing instance of another class. There are many scenarios when you may have to do this, for example: Creating the domain class instance from the entity class instance Creating…
-
Video : Getting started with the Automapper in C-Sharp
This video will help you in getting started with the Automapper. Please give feedback in comment to improve further
-
Keep your code DRY
Other day my Boss was reviewing the code written by me. He had a feedback, keep the code DRY. It was great feedback, and I thought why not to share with you that what does DRY mean? DRY stands for Do not Repeat Yourself. To understand it better let is consider below code snippet: I…
-
Understanding IEnumerable and IQueryable in C#
I see developers are not that confident about usage of the mentioned interfaces. In this post, I am going to discuss basic differences among IEnumerable and IQueryable and in which scenario to use what
-
The call is ambiguous between the following methods in C#
the call is ambiguous between the following methods in C# can be resolved as easily as given discussed above.
-
Video: What is Extension Method in C-sharp
In this video you will learn about Extension Method in C-sharp
-
Video: is and as operator in C-sharp
In this video you will learn about is and as operator in C-sharp
-
Single Responsibility Principle in C-Sharp: Simplified
Let us start with understanding what is SRP? Single Responsibility Principle says every class should have single responsibility and all the responsibility should be encapsulated in the class. To explain it further assume you are creating a creating class to Calculate Salary. Now if you have two methods in class like below. Usually we can…