Difference between Automatic Properties and public field in C# 3.0

后端 未结 7 1179
忘掉有多难
忘掉有多难 2020-12-01 23:50

I failed to understand why auto implemented property language feature exist in C# 3.0.

What the difference it is making when you say

public string Fi         


        
7条回答
  •  囚心锁ツ
    2020-12-02 00:12

    because of this use:
    public string FirstName { get; private set; }
    easy property, that 'kosher' by OO rules

提交回复
热议问题