I would like you to help me I have 3 instances of a class that have the attributes period, soles_vac, dollars_vac, expenses
by which in each instance I have in the same period different amounts in different attributes I would like you to only get now that per period already get the attributes as well as the image
I did it with linq through a groupby but I did not get what it required.
public static list<Flujo>Crear(List<Flujo> ListaFlujo)
{
return ListaFlujo.GroupBy(f =>f.periodo).Select(f =>new FlujoSP
{
periodo = f.FirstOrDefault().Periodo,
Soles_vac =f.FirstOrDefault().Soles_vac ,
Dolares_vac =f.FirstOrDefault().Dolares_vac ,
gastos = f.FirstOrDefault().gastos
}).ToList();
}