Пример #1
0
        public static ProcessFileAggregate New(string fileId, string name, string description, int version, string payload)
        {
            var result = new ProcessFileAggregate();
            var evt    = new ProcessFileAddedEvent(Guid.NewGuid().ToString(), BuildProcessDefinitionIdentifier(fileId, version), version, fileId, name, description, DateTime.UtcNow, payload);

            result.Handle(evt);
            result.DomainEvents.Add(evt);
            return(result);
        }
Пример #2
0
 private void Handle(ProcessFileAddedEvent evt)
 {
     AggregateId    = evt.AggregateId;
     FileId         = evt.FileId;
     Name           = evt.Name;
     Description    = evt.Description;
     CreateDateTime = evt.CreateDateTime;
     Payload        = evt.Payload;
     Version        = evt.Version;
     Status         = ProcessFileStatus.Edited;
 }