public Template( string descricao, TemplateValue value) { Status = TemplateStatus.Ativo; _statusId = TemplateStatus.Ativo.Id; Update( descricao, value); }
public void Update( string descricao, TemplateValue value) { Description = descricao ?? throw new ArgumentNullException(nameof(Description)); Value = value ?? throw new ArgumentNullException(nameof(Value)); if (Id == 0) { AddDomainEvent(new TemplateCreatedDomainEvent(this)); } else { AddDomainEvent(new TemplateChangedDomainEvent(this)); } }