I think that the next line for BaseType should do the trick (untested):
"DataObjectBase`1[[Refund]]"
You may need to provide the full name for the Refund , at least, including the name of the assembly:
"DataObjectBase`1[[Refund, RefundAssembly]]"
And you need to remove the line targetClass.TypeParameters.Add(...) .
source share