Get parent of class of instance

c#

Solution

instance.GetType().BaseType.GetGenericArguments()[0]

Problem

I have the following class: ``` public class POCOConfiguration : EntityTypeConfiguration<POCO> { public POCOConfiguration() { } } ``` ``` POCOConfiguration instance = new POCOConfiguration(); ``` How can I get the type `POCO` from the instance? Thanks

Original source