private PageInstance BuildPage(Template template, bool isPreview, IEnumerable <IContextItem> contextItems = null, string cacheControl = null) { if (isPreview) { template.ApplyAmendments(this.componentLibrary); } var renderingInstructions = isPreview ? RenderingInstructions.BuildForPreview() : RenderingInstructions.Build(cacheControl); var builder = new Builder(renderingInstructions, this.widgetSpecificationRepository.Find, this.componentLibrary); return(builder.Build(template, new BuildData(contextItems))); }