I tried to retrieve the TYPE for “PreProcess” from DomainDB class using
Type.GetType("DomainDBManager.DomainDB`1[System.String]+PreProcess")
but this is returning null. Is there anyway to get the Public Field “PreProcess” using Type.GetType?
namespace DomainDBManager
{
public class DomainDB<T>
{
public Action<string> PreProcess;
}
}
You’re currently trying to get a type by name –
PreProcessis a field of theDomainDB<T>type, soType.GetTypeisn’t going to work. You need to get the type first, and then get the field from that: