using System; using System.Linq; using System.Collections.Generic; using System.Collections.Concurrent; using System.Reflection; using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; Animal value = new Cat(); Type runtime = value.GetType(); Console.WriteLine($"runtime:{runtime.Name}"); Console.WriteLine($"base-accepts:{typeof(Animal).IsAssignableFrom(runtime)}"); Console.WriteLine($"derived-accepts:{typeof(Cat).IsAssignableFrom(typeof(Animal))}"); class Animal { } sealed class Cat : Animal { }