samedi 25 juin 2016

Why does my list of PropertyInfo shows count=0 [duplicate]

This question already has an answer here:

I have a class called "summoners" with properties :

public string Name;
public string Id;
public int summonerLevel;
public string division;

public string tier;
public int leaguePoints;

To debug, i wanted to create a List<PorpertyInfo> and store every property name in it, i have :

        public void listProperties()
    {
        List<PropertyInfo> t = new List<PropertyInfo>();

        foreach (var attr in this.GetType().GetProperties())
        {
            t.Add(attr);
        }
    } //-> breakpoint

I placed a brakepoint and it tells me that there is no value in "t"





Aucun commentaire:

Enregistrer un commentaire