Solid C# code example

Example: solid principles c#

// Every world has its meaning
S: is single responsibility principle (SRP) 
   A class should take care of a Single Responsibility
   
O: stands for open closed principle (OCP) 
   Prefer extension over modification
   
L: Liskov substitution principle (LSP)
   The parent class should be able to refer child objects seamlessly during runtime polymorphism
     
I: interface segregation principle (ISP)
   A client should not be forced to use an interface, if it doesn’t need it 
   
D: Dependency injection principle (DIP)
   High level modules should not depend on low-level modules, but should depend on abstraction.