I am generating value objects and I want to switch my approach from templates to CodeDom approach.
I want my types to implement one or two self-referencing generic interfaces (namely IEquatable<MyValueObject> and IComparable<MyValueObject>).
I have been able to get the desired result by doing string manipulation and calling the equivalent of CodeTypeDeclaration.Members.Add("IEquatable<MyValueObject"), but I would rather use the object model if this is possible. Is there a better way or are strings going to be my best bet?
You can do something like: