How can I get my property? Currently an error is occuring of Ambiguous match found
, see the comment line in code.
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
}
if (winform.GetType().GetProperty("Items") != null) {..}
in which case one merely switches Exceptions using Linq... – Doing