private static TypeCode TypeCodeFor(IType type)
{
var externalType = type as ExternalType;
if (externalType != null)
return Type.GetTypeCode(externalType.ActualType);
throw new NotImplementedException(string.Format("TypeCodeFor({0}) not implemented!", type));
}