C#, C++, VB, WPF,Angular 2,Angular JS, WCF, WF, MVC, Typescript,ASP.NET, ORACLE, SQL SERVER, SYBASE,Classic ASP, VB6, Dev Express, Visual Studio Add-ins,Windows Service,Web Service, Winforms, Windows Phone, XSLT, JQuery, CSS, JSon, LINQ, EntityFramework, Performance, Problems & Solutions, Batch File, CMD, Data structure and Algorithm, Automation, SGML, Javascript,XAML,Network
Friday, 27 February 2026
Interface Segregation Principle - SOLID Principle
Saturday, 21 February 2026
Liskov Substitution Principle - SOLID Principle using C# in .NET10
In this article are going to see what is Liskov Substitution Principle, Objects of the super class can be replaced by objects of the sub classes with out breaking the correctness of the program..
We take one example we take Shape class where we have the Area method which will calculate the area, but when you see the Square which will break the behaviour, if the values are not Equal. the Values of the variable are needs to be Equal for Square
How we make this class to LSP, the Base class behaviour should not broke, so we slightly change the code which adhere to Liskov substitution principle.
From the above code you can learn what is Liskov Substitution Principle.
Monday, 16 February 2026
Open Closed Principle - SOLID Principle
In this article we are going to see what is Open Closed Principle (OCP) in SOLID. OCP is open for extension and closed for modification. that means a class can be extended through override and not allow to modify.
we see Employee class in which GetSalary is used to fetch the salary this method can be override in Manager class which is derived from employee class but not allow to modify the employee class.
From this article you can learn the Open Closed Principle
Sunday, 15 February 2026
SOLID - Single Responsibility Principle
In this article we are going to see what is single responsibility principle (SRP) in SOLID. The SRP is about the class should have only one responsibility or we can say like it should talk about only one entity. For Example if it is a Employee class, then it should have behaviour and properties only about Employee. simply says the class should have only one reason to change.
First we will see a class which violating the SRP.
In the above class Salary we see that three methods
1. one is calculating Salary.
2. another one is save to DB
3. another one is Print to Salary.
So the first one is application logic , second one is DB layer, third one is UI layer code, all are three different behaviour, now this is violating the SRP.
How we can convert this to SRP.
Now if you see above example three classes in which each one have one responsibility, first one is business logic, second one is DB logic, third one is UI logic.
Now we can see a Logger class which is in SRP.
The above class is Logger, which have only one responsibility or talks about only one entity Logging message. if we have another method like PrintMessage() in the class then that is irrelevant to the class then that is violating the SRP
Wednesday, 11 February 2026
Implementation of Repository pattern and Unit Of Work in .NET10 - Example 2
In this post we are going to see the example 2 of implementation of repository pattern and unit of work in .Net10. we separate the project in to four layers.
1. Domain or Entities
2. Application or UseCase
3. Infrastructure
4. Controllers
Dependencies:
Domain or Entities:
- It is consists of Entities.
- It is consists of Repositories and Unit Of Work Interfaces.
- It is consists of declaration of Application Service Interfaces with public access.
- It is consists of Implementation of Application Services with internal access,
- Usage of Repositories in the Application Services
- To register the services in main program, we have to declare composition root.
- Consists of implementation of Repositories and Unit Of Work with internal access, which can be changed easily,in the future so business logic wont get change, because the application layer work with abstractions.
- To register the repositories in main program we have to declare composition root.
- Uses the Register method from application layer and infrastructure layer.
Monday, 9 February 2026
Implementation of Repository Pattern and UnitOfWork in .NET10
In this article we are going to see the what is the repository pattern and it's usage. we will see the implementation of Repository Pattern and UnitOfWork in .NET10.
using repository pattern we can decouple the abstraction and its implementation of DB layer, we can work with abstraction the implementation of that abstraction will be change based on the requirement and we can change the DB layer easily.
Now we will see the interface or abstraction of UnitOfWork.
We have a Domain class named Authors:
Authors:
Create this IRepository class in the Domain layer where it will be referred in App Layer for usage, the implementation must be in infrastructure layer.
Application Layer or UseCase Layer
AuthorService
UnitOfWork:
Controller Layer
We have to use the composition root for register the services in infrastructure layer. and use it in the controller layer.
From this article we can learn the repository pattern and its implementation along with UnitOfWork in .NET10.