mardi 24 mars 2020

C# Reflection method GetProperties(BindingFlags.Instance) not returning child class objects

I am attempting to retrieve the child classes of an object while omitting primitive types.

   public class Dog
    {
    public int Id {get;set;}
    public int Name {get;set;}
    public Breed Breed {get;set;}
    }

var dog = new Dog(); var children = dog.GetType().GetProperties(BindingFlags.Instance);

Why does the children array not contain the breed property?





Aucun commentaire:

Enregistrer un commentaire