Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

a quick reflections question

$
0
0

i have this

public class ClassA
{
     public IList<ClassB> PropertyB { get; set; } = new List<ClassB>();
}

public class ClassB
{

}

var a = new ClassA().PropertyB.GetType();
var p = new ClassA().GetType().GetProperty("PropertyB").GetType();

Assert.IsTrue(a.IsGenericType);//This passes
Assert.IsTrue(p.IsGenericType);//This fails 

and someone explain why?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>