-
-
Save bernardobrezende/4483451 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NotaFiscal : Entidade | |
{ | |
private IList<Item> itens; | |
public virtual IEnumerable<Item> Itens { get { return this.itens; } } | |
public virtual string Descricao { get; set; } | |
public virtual decimal ValorTotal { get; protected set; } | |
protected NotaFiscal() { } | |
public NotaFiscal(string descricao) | |
{ | |
// TODO: validações para construção | |
this.Descricao = descricao; | |
} | |
public virtual void AdicionarItem(Item item) | |
{ | |
if (item != null) | |
{ | |
this.itens.Add(item); | |
this.ValorTotal += item.Valor; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment