Property backing value scope

前端 未结 6 1312
情书的邮戳
情书的邮戳 2021-02-12 19:10

Is anything like this possible? I\'m assuming not, but it looks good to me:

class MyClass {
    public int Foo {
        get { return m_foo; }
        s         


        
6条回答
  •  [愿得一人]
    2021-02-12 19:57

    Nope, the only thing that can be within the the body of the property is the get and set.

提交回复
热议问题