I'm trying to call an object from a string, which contains its namespace, class and object name, however, all of these are variables and I do not have a fixed object type
I found a similar question , but she does not answer me.
In the above question, the code creates a list of a specific object, and I need to call objects from different classes.
I've tried the following code, but the types always return nulls.
class tstProcessa
{
public static void processar(JSON.Arquivo Arq)
{
var DE = $"Origem.{Arq.Origem.Empresa}.{Arq.Origem.Sistema}.{Arq.Origem.Tabela}";
//Origem.x.FINANCEIRO.cadcli;
var PARA = $"Destino.{Arq.Destino.Empresa}.{Arq.Destino.Sistema}.{Arq.Destino.Tabela}";
//Destino.y.FINANCEIRO.cadastro_cli;
Type t1 = Type.GetType("Destino.y.FATURAMENTO.cadastro_cli, AssemblyName");
Type t2 = Type.GetType(DE);
Type t3 = Type.GetType("tstProcessa");
int a1 = 0;
}
}
Is there any way to Make this call?