Possible Duplicate:
Differences between Private Fields and Private Properties
Let’s say I have a class MyClass that has a private property MyProp.
What’s the difference between
public class MyClass
{
private int MyProp { get; set; }
}
and
public class MyClass
{
private int MyProp = 0;
}
What’s better to use?
Thanks.
Difference between Property and Field in C# 3.0+
http://csharpindepth.com/articles/chapter8/propertiesmatter.aspx