Exemple #1
0
 public Template(
     string descricao,
     TemplateValue value)
 {
     Status    = TemplateStatus.Ativo;
     _statusId = TemplateStatus.Ativo.Id;
     Update(
         descricao,
         value);
 }
Exemple #2
0
        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));
            }
        }