I want to treat a list in a method from another class and then return the treated list. I would like to know how to transfer this list to the other class.
I did as follows:
Main class:
DataTable result = new DataTable();
VerificaJuridico vj = new VerificaJuridico();
List<DataRow> rows = result.Rows.Cast<DataRow>().ToList();
List<DataRow> list = new List<DataRow>(result.Select());
vj.ChecaJuridico(list);
Second Class:
namespace Comunicacao
{
public class VerificaJuridico
{
public void ChecaJuridico<T>(List<T> lista)
{
foreach (var t in lista)
{
}
}
}
}
When running the program, the main class transfers the value, but the second class running the method does not bring anything, what can it be? Is something wrong with the transfer?