Possible Duplicate:
Difference between Property and Field in C# .NET 3.5+
What's the difference between using
public string Username { get; set; }
and using
public string Username;
I have always been using the first one, but wanted to understand if there is any difference between the two, and scenarios when one should prefer over the other.
public string Username { get; set; }
while
public string Username;
For more comparison,
Other link
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With