dimanche 1 avril 2018

C# - Get all properties of a generic type by reflection [duplicate]

This question already has an answer here:

My code:

public abstract class Entity
{
    // I need a method here
}

public abstract class ValueObject<T> where T : ValueObject<T>
{
}

public class User : Entity
{
    public Password Password { get; private set; }
}

public class Password : ValueObject<Password>
{
}

I need a method in the Entity class that gets all properties of type ValueObject





Aucun commentaire:

Enregistrer un commentaire