I have a abstract base C# class with a couple of methods that has to be overrided. How can I enforce this? Right now I throw an exception as a base implementation
public virtual string Description { get { throw new NotImplementedException(); } } public virtual string ErrorMessage { get { throw new NotImplementedException(); } }
That solution however feels a bit wrong and very little intuitive … Are there other ways to solve this in C#?
Make the properties (these are not methods in your example) abstract.