Now when you use get; set; it is property of class. It can also set from other class but diffrence it is access like method and it provide other functionality like notification of property change and all that. Use filed when you don’t want any control over it but if you want to control then use property.
What is the use of Get and set in C#?
A get property accessor is used to return the property value, and a set property accessor is used to assign a new value. In C# 9 and later, an init property accessor is used to assign a new value only during object construction. These accessors can have different access levels.
What is get in C#?
The get keyword defines an accessor method in a property or indexer that returns the property value or the indexer element. For more information, see Properties, Auto-Implemented Properties and Indexers. … Starting with C# 7.0, you can implement the get accessor as an expression-bodied member.