Search code examples
c#automatic-properties

Is this the correct syntax for auto properties?


I've been programming for so long its hard to keep up with language changes sometimes...

Is it really ok to set properties like this after .net v2

    public string LocaleName
    {
        get;
        set;
    }

Not requiring an inner field? Seems like the compiler takes care of this lately?


Solution

  • Yes, this is a new feature in C# 3.0