Example #1
0
 public void Append(Guid projectId, ProjectHealthRisk healthRisk, DateTimeOffset effectiveFromTime)
 {
     Insert(new ProjectHealthRiskVersion
     {
         Id = Guid.NewGuid(),
         EffectiveFromTime = effectiveFromTime,
         HealthRisk        = healthRisk,
         ProjectId         = projectId
     });
 }
Example #2
0
        public void Process(ProjectHealthRiskAdded @event)
        {
            var project = _projects.GetById(@event.ProjectId);

            var projectHealthRisk = new ProjectHealthRisk
            {
                HealthRiskId = @event.HealthRiskId,
                Threshold    = @event.Threshold
            };

            project.HealthRisks.Append(projectHealthRisk);

            _projects.Update(project);
        }