C# properties: how to use custom set property without private field?

Solution 1:

Once you want to do anything custom in either the getter or the setter you cannot use auto properties anymore.

Solution 2:

You can try something like this:

public string Name { get; private set; }
public void SetName(string value)
{
    DoSomething();
    this.Name = value;
}