public Phase ToModel()
 {
     return(new Phase(ToModelName(), ReleaseRetentionPolicy?.ToModel(), TentacleRetentionPolicy?.ToModel(),
                      MinimumEnvironmentsBeforePromotion,
                      AutomaticDeploymentTargetRefs.EnsureNotNull().Select(name => new ElementReference(name)),
                      OptionalDeploymentTargetRefs.EnsureNotNull().Select(name => new ElementReference(name))));
 }
 public Lifecycle ToModel()
 {
     return(new Lifecycle(
                ToModelName(),
                Description,
                ReleaseRetentionPolicy?.ToModel(),
                TentacleRetentionPolicy?.ToModel(),
                Phases.EnsureNotNull().Select(p => p.ToModel())));
 }