I have the following structure:
public class Insumo{
public int Insumo_id { get; set; }
public List<InsumoDados> Dados{ get; set; }
}
public class InsumoDados{
public int Desc { get; set; }
public decimal Valor{ get; set; }
}
I need to query the database so that it already returns a list of the Input class. Preferably with linq. Something like:
var listInsumo = (from insumo in banco.orc_insumo
select new Insumo
{
Insumo_id = insumo.insumo_id,
.
.
.
Can anyone help me? Thank you.