In this chart about the features that are in or out of the next version of Roslyn (specifically, for C#), primary constructors are out, but auto-property initializers are in.
The best use case I've seen for the auto-property initializers is using them in conjunction with the primary constructors, i.e.:
public class Customer(string first, string last)
{
public string First { get; } = first;
public string Last { get; } = last;
}
However, without the primary constructor, I don't see a good use case for using auto-property initialization that can't just be performed with a normal backing field, like so:
public class Customer
{
private string _first = "Foo";
public string First { get { return _first; } };
}
What is the point of using an auto-property initializer without the primary constructor functionality?