I'm currently developing a WPF project and most of my properties have two options to assign a value internally:
private int counter = 0;
public int Counter {
get {
return counter;
}
private set {
counter = value;
}
}
Assigning via a private setter Counter = 1;
Assigning the value directly to the private object counter = 1;
Which is the preferred way to assign a value internally (in the class itself)? Is there any benefit using one over another?