Hi, i have 2 tables:
Asiento
********
Id_Asiento integer key
Fecha date
It_Asiento
**********
Id_Asiento integer Forenkey
Importe float
I wan to do This SQL Query with Linq
select Asiento.Id_Asiento, Asiento.Fecha, Sum(It_Asiento.Importe)
From Asiento
join It_Asiento
on Asiento.Id_Asiento = It_Asiento.Id_Asiento
and It_Asiento.Importe > 0
group by Asiento.Id_Asiento, Asiento.Fecha
On my DataBase boot tables have a relation, so on C# / Linq i don't need to make a join, right??
I try this, but don't work
IQueryable listAsientos = from it_a in dc_Asientos.It_Asientos
where it_a.importe > 0
group it_a by it_a.id_asto, it_a.Asiento.fecha
**//¿it_a.ASiento.Fecha??????**
into resultado
select new
{
id_asto = resultado.Key,
**/¿¿¿¿¿fecha = it.a.Asiento.Fecha?????**
suma = resultado.Sum(it => it.importe)
};
Can somebody help me? SORRY for my poor English.