Ejemplo n.º 1
0
 public Note(NoteState state)
 {
     if (state == null)
     {
         throw new ArgumentNullException(nameof(state));
     }
     State = state;
 }
Ejemplo n.º 2
0
        public Note(Guid id, Guid taskId, string text)
        {
            if (string.IsNullOrWhiteSpace(text))
            {
                throw new ArgumentException(nameof(text));
            }
            if (id.Equals(Guid.Empty))
            {
                throw new ArgumentException(nameof(id));
            }
            if (taskId.Equals(Guid.Empty))
            {
                throw new ArgumentException(nameof(taskId));
            }

            State = new NoteState(id, taskId, text);
            var noteCreated = new NoteCreated(id, taskId, text);

            _events.Add(noteCreated);
        }