Reflexão GetProperty resulta em "Correspondência ambígua encontrada" na nova propriedade
Como posso obter minha propriedade? Atualmente, está ocorrendo um erroAmbiguous match found
, veja a linha de comentário no código.
public class MyBaseEntity
{
public MyBaseEntity MyEntity { get; set; }
}
public class MyDerivedEntity : MyBaseEntity
{
public new MyDerivedEntity MyEntity { get; set; }
}
private static void Main(string[] args)
{
MyDerivedEntity myDE = new MyDerivedEntity();
PropertyInfo propInfoSrcObj = myDE.GetType().GetProperty("MyEntity");
//-- ERROR: Ambiguous match found
}