Exemplo n.º 1
0
        public static MedicalfileAggregate New(string prescriberId, string patientId, string patientNiss, string patientFirstname, string patientLastname)
        {
            var id     = BuildId(prescriberId, patientId);
            var evt    = new MedicalfileAddedEvent(Guid.NewGuid().ToString(), id, 0, prescriberId, patientId, patientNiss, patientFirstname, patientLastname, DateTime.UtcNow, DateTime.UtcNow);
            var result = new MedicalfileAggregate();

            result.Handle(evt);
            result.DomainEvents.Add(evt);
            return(result);
        }
Exemplo n.º 2
0
 private void Handle(MedicalfileAddedEvent evt)
 {
     Id               = evt.AggregateId;
     Version          = evt.Version;
     PrescriberId     = evt.PrescriberId;
     PatientId        = evt.PatientId;
     PatientNiss      = evt.PatientNiss;
     PatientFirstname = evt.PatientFirstname;
     PatientLastname  = evt.PatientLastname;
     CreateDateTime   = evt.CreateDateTime;
     UpdateDateTime   = evt.UpdateDateTime;
 }