【发布时间】:2009-08-28 16:58:49
【问题描述】:
这是我希望生成的类声明的样子:
public sealed partial class Refund : DataObjectBase<Refund>
{
}
}
这段代码(截断):
targetClass = new CodeTypeDeclaration(className);
targetClass.IsClass = true;
targetClass.TypeAttributes =
TypeAttributes.Public | TypeAttributes.Sealed;
targetClass.IsPartial = true; //partial so that genn'ed code can be safely modified
targetClass.TypeParameters.Add(new CodeTypeParameter{ Name=className});
targetClass.BaseTypes.Add(new CodeTypeReference { BaseType = "DataObjectBase", Options = CodeTypeReferenceOptions.GenericTypeParameter });
产生这个类声明:
public sealed partial class Refund<Refund> : DataObjectBase
{
}
我做错了什么?
【问题讨论】:
标签: c# codedom type-parameter