0
In my list there are 4 items with code 711, however I just want to get an item inside that list, is there a better way to do this? Because when I fill in my append, it writes the data of the 4 and not only of 1 item of that same list. The correct would be to fill in this way:
Code:
foreach (Movimentacao mov in listaMovimentacao)
{
foreach (ItemMovimento dadosItensMov in listaItemMovimentacao.Where(o => o.Movimentacao.Codigo == mov.Codigo).OrderBy(o => o.Movimentacao.ContratoOperCred.Codigo))
{
strConstrution.Append(string.Format(dadosDetalhamentos, dadosItensMov.Movimentacao.ContratoOperCred.Codigo + " " + dadosItensMov.Movimentacao.OperacaoCredito.DescricaoOperacaoCredito,
dadosItensMov.ValorMovimentoMC.ToString("N2"), sumJuros.ToString("N2"), sumEncargos.ToString("N2"), dadosItensMov.Movimentacao.ValorTotalMovimentoMC.ToString("N2")));
}
}
Don’t get it, you want to bring only one record per code? or only the 711?
– Leandro Angelo
Of the index 0 to 3 that appears in the list all have the code 711, however I only want to get the index 2.
– Robson
@Leandroangelo there is a way to do?
– Robson