The easiest way to show them in terms of C # 1:
public class Foo { private readonly string bar = "Bar"; public string Bar { get { return bar; } } public string Bar2 { get { return "Bar2"; } } }
As you can see, the first includes a field, the second does not. So you usually use the first with something where each object can have a different state, for example. installed in the constructor, and the second with something that is constant in all objects of this type, so no state is required for each object (or where you simply delegate to other members, of course).
Basically, ask yourself which of the above code snippets would you write if you didn't have C # 6, and choose the appropriate C # 6 path.
source share