public void Processa(IList <Boleto> boletos, Fatura fatura) { foreach (Boleto boleto in boletos) { Pagamento pagamento = new Pagamento(boleto.Valor, MeioDePagamento.BOLETO); fatura.AdicionaPagamento(pagamento); } }
public void Processa(List <Boleto> boletos, Fatura fatura) { double total = 0; foreach (Boleto boleto in boletos) { Pagamento pagamento = new Pagamento(boleto.Valor, MeioDePagamento.Boleto); fatura.AdicionaPagamento(pagamento); total += boleto.Valor; } }