using System;
using System.Linq;
using System.Reflection;
public class Test
{
public static void Main()
{
var derived = new Derived();
var baseType = derived.GetType().BaseType;
var classCField = baseType.GetField("_classC", BindingFlags.NonPublic | BindingFlags.Instance);
Console.WriteLine(classCField.GetValue((Base)derived));
}
}
public class ClassC
{
}
public abstract class Base// : IBase where A : class where B : class, new()
{
private readonly ClassC _classC = new ClassC();
}
public class Derived : Base//
{
}