Beispiel #1
0
        public void Resgatar(Fundo fundo, decimal valorInvestido)
        {
            ResgateService resgate = new ResgateService(this, valorInvestido, fundo);

            if (resgate.isValid())
            {
                Movimentacoes.Add(resgate.Movimentacao);
            }
        }
Beispiel #2
0
        public void Investir(Fundo fundo, decimal valorInvestido)
        {
            InvestimentoService investimento = new InvestimentoService(this, valorInvestido, fundo);

            if (investimento.isValid())
            {
                Movimentacoes.Add(investimento.Movimentacao);
            }
        }
Beispiel #3
0
 public decimal ValorTotalDisponivel(Fundo fundo)
 {
     return(Movimentacoes.Where(x => x.Fundo == fundo).Sum(x => x.ValorInvestido));
 }
Beispiel #4
0
 public bool InvesteEm(Fundo fundo)
 {
     return(Movimentacoes.Any(x => x.Fundo == fundo));
 }