xxxxxxxxxx
private string name;
public string Name
{
get
{
return this.name;
}
set
{
this.name = value;
}
}
xxxxxxxxxx
public class MyClass
{
private string myProperty;
// Property getter and setter
public string MyProperty
{
get { return myProperty; }
set { myProperty = value; }
}
}
// Usage
MyClass obj = new MyClass();
obj.MyProperty = "Hello"; // Setting the value
string value = obj.MyProperty; // Getting the value
xxxxxxxxxx
private string _name;
public string Name
{
get
{
return this._name;
}
set
{
this._name = value;
}
}
xxxxxxxxxx
public class NameChanger
{
public string Name { get; set; }
public void changename(string InputtedName)
{
Name.Equals(InputtedName.ToString()) // one of the ways you can edit a
// { get; set; } var's value.
}
}