How do I create a class that inherits from another and passes a type parameter in CodeDom?

前端 未结 2 1930
感情败类
感情败类 2021-01-20 03:42

Here\'s what I want the resulting class declaration to look like:

public sealed partial class Refund : DataObjectBase
 {
}

}<

2条回答
  •  难免孤独
    2021-01-20 04:23

    If you use Expressions to CodeDOM it could be

    var cls = Define.Class("Refund", 
       TypeAttributes.Public | TypeAttributes.Sealed, true)
       .Inherits(CodeDom.TypeRef("DataObjectBase","Refund"))
    

提交回复
热议问题