You do not need to use a structure to prevent adding a class. You can use the keyword sealed
public sealed class MyDTOObject { ... }
Now you canβt be inherent in the class and also prevent inheritance (which is essentially what you ask for). The mere fact of inheritance of MyDTOObject is the creation of a new class that is based on , not equal to or limited to, or defined in some way by the implementation of MyDTOObject .
You can use the abstract class to force derived classes to implement specific methods, but not vice versa.
If you want others to not leave your class and not use helper methods, you should use the sealed or mark the inner class.
source share