protected override IMultistepActionStageCommand CreateCommand(MultistepActionStageCommandState state) { var site = SiteRepository.GetByTemplateId(state.Id); if (site == null) { throw new ApplicationException(string.Format(SiteStrings.SiteNotFound, state.ParentId)); } switch (state.Type) { case BuildSiteStageCommandTypes.BuildTemplates: return(new AssembleTemplateCommand(state)); case BuildSiteStageCommandTypes.BuildPages: return(new AssemblePagesCommand(state, false, site.IsDotNet)); case BuildSiteStageCommandTypes.BuildNotifications: return(new AssembleNotificationsCommand(state, false)); default: throw new ApplicationException("Undefined Site Building Stage Command Type: " + state.Type); } }