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
instance.GetType().BaseType.GetGenericArguments()[0]
Another answer is simply that instance.GetType().BaseType
returns the base Type of class o parent class.
instance.GetType().BaseType.GetGenericArguments()[0]
can throw an exception.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With