Example #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);
        }
Example #2
0
        public static MedicalfileAggregate New(IEnumerable <DomainEvent> events)
        {
            var result = new MedicalfileAggregate();

            foreach (var evt in events)
            {
                result.Handle(evt);
            }

            return(result);
        }