mardi 15 mai 2018

Reason behind the get prefix in c#

Considering that in c# we have a specific syntax for properties with getters and setters, why are some properties accessed with methods (usually prefixed with 'Get') instead of a getter?

for example why is it:

var properties = object
    .GetType()
    .GetProperties();

instead of using a getter like:

var properties = object
    .Type
    .Properties





Aucun commentaire:

Enregistrer un commentaire