c#: getter/setter

Viewed 303380

I saw something like the following somewhere, and was wondering what it meant. I know they are getters and setters, but want to know why the string Type is defined like this. Thanks for helping me.

public string Type { get; set; }
9 Answers

You can also use a lambda expression

public string Type
{
    get => _type;
    set => _type = value;
}
Related