The problem goes like this: let’s assume we’re writing a program and we’ve created IShape interface (which might have methods to calculate circumstance and area of the shape). Now we create Ellipse, which implements IShape interface and follows that with Circle class. Now since Circle is a special case of Ellipse, and every circle is an Ellipse it naturally should inherit from Ellipse.
The snipped from SO
Recently, while looking for a solution to a simple problem of parsing a string into Enum that would have a default value, I’ve found this solution on Stack Overflow:
TypeEnumeration type = Enum.TryParse(inputString, out type) ? type : TypeEnum.Default