Good morning everyone. my question is this, I have the following method in my model:
public IQueryable GetConsulta()
{
var q = (from c in Datacontext.Tabela1
join b in Datacontext.Tabela2 on c.CodClase equals b.CodClase
join d in Datacontext.Tabela3 on b.CodImobilizado equals d.CodImobilizado
where c.CodClase == b.CodClase && b.CodImobilizado == d.CodImobilizado
select new
{
taxa = c.Taxa,
ano = DateTime.Parse(b.Data).Year,
data = d.Data,
valorAquisicao = b.Valor,
});
return q;
}
In View you look like this:
void getConsulta(){
var a = model.GetConsulta();
foreach(var linha in a){
//faça algo
}
}
The problem is that I can not access the variables created in the model's foreach method.
Someone could help me.