Override Default Constructor of Partial Class with Another Partial Class

前端 未结 12 1843
时光取名叫无心
时光取名叫无心 2020-12-28 12:59

I don\'t think this is possible, but if is then I need it :)

I have a auto-generated proxy file from the wsdl.exe command line tool by Visual Studio 2008.

Th

12条回答
  •  长发绾君心
    2020-12-28 13:39

    This is not possible. Partial classes are essentially parts of the same class; no method can be defined twice or overridden, and that includes the constructor.

    You could call a method in the constructor, and only implement it in the other part file.

提交回复
热议问题