Can you explain Liskov Substitution Principle with a good C# example?
Can you explain Liskov Substitution Principle (The 'L' of SOLID) with a good C# example covering all aspects of the principle in a simplified way? If it is really possible. jgauffin (This answer has been rewritten 2013-05-13, read the discussion in the bottom of the comments) LSP is about following the contract of the base class. You can for instance not throw new exceptions in the sub classes as the one using the base class would not expect that. Same goes for if the base class throws ArgumentNullException if an argument is missing and the sub class allows the argument to be null, also a LSP