public ActionResult Preview(long?id) { var model = ContentManager.GetContent(id); if (model == null) { return(RedirectToAction("Index", "Content", new { @id = "", @area = G.AdminPath })); } var m = new ContentPostViewModel(model); return(View(m.ViewPath, m)); }
public static void Setup <BaseIContentType>( Func <ICrud> getCrud, Func <ISecretService> getSecretService, Func <string> getContentViewPath, Func <string> getContentPageUrl, SaveFile getSaveFile, DeleteFile getDeleteFile, Func <SystemConfig> config, Func <IModelService> modelService) where BaseIContentType : class, IContentModel { ContentPostViewModel.Init(getContentViewPath, getContentPageUrl); MyReflectExtends.Init(getCrud); AbstractBaseContent.Init <BaseIContentType>(getCrud); PassModeConvert.Init(getSaveFile, getDeleteFile, getCrud, getSecretService); TypeExtends.Init <BaseIContentType>(config, modelService); }