Skip to main content

CSharp Properties

[CSharp]

CSharp Properties

The difference between...

// expression-bodied member property
public int MaxHealth => x ? y:z;
// And...
// field with field initializer
public int MaxHealth = x ? y:z;
// Is the same as the difference between...
public int MaxHealth
{
get
{
return x ? y:z;
}
}
// And...
public int MaxHealth = x ? y:z;