I am new to C# language. There are different syntax for Get; Set property. Like
public string Name
{
get
{
return this.name;
}
set
{
this.name = value;
}
}
public string Name
{
get { return _name; }
set { _name = value; }
}
protected string Name { get; set; }
What is the difference between these syntax? Does following different syntax have any impact on functionality? or all the syntax will perform same function?
First two syntaxes are exactly the same, because you can safle omit
this
keyword.Third works exactly the same but generates backing field automatically making the code shorter and easier to write.