For the past few years I have been assigning a C#
Property to a field.
I saw some code today that just had
public String Title
{
get;set;
}
I was thinking this was just un-finished code. However the program worked and returned the Title String!
I have been doing this
private string _title;
public String Title
{
get { return this._title; }
set { this._title = value; }
}
So here my question is, is there any benefit, or need to write the properties by attaching them to a field like I have been doing for the past 2 years?