I have read about how in ASP.NET 3.5 you can declare properties in C#
public DateTime DisplayDate
{
get;
}
instead of
private DateTime _displayDate
public DateTime DisplayDate
{
get {return _displayDate;}
}
My question is, within the class, how do I access the private variable?
For example instead of this
public MyClass(DateTime myDisplayDate)
{ _displayDate = myDisplayDate; }
What should I assign to? Is it the public property?
public MyClass(DateTime myDisplayDate)
{ DisplayDate = myDisplayDate; }
Is this Correct?