Can C# extension methods access private variables?

前端 未结 7 979
借酒劲吻你
借酒劲吻你 2021-02-01 11:49

Is it possible to access an object\'s private variables using an extension method?

相关标签:
7条回答
  • 2021-02-01 12:37

    If you own the class that you are extending, you an always declare the class partial, then extend the class & have access to all the private members in a different file... But you wouldn't really be using extension methods.

    0 讨论(0)
提交回复
热议问题