public ActionResult Create(string name) { var document = new Document() { Name = name, Content = "", CreatedOn = DateTime.Now}; var workflow = new CreateOrUpdateDocumentWorkflow(this.dataManager, document, string.Empty); var result = workflow.Execute(); if (result.TotalSuccess) { return RedirectToAction("Edit", new { identifier = document.Identifier }); } else { throw new Exception("hey there was a problem"); } }
public List<Document> FindPreviousVersions(Document document) { var rtn = new List<Document>(); if (document.ParentId != 0) { var parent = this.Find(document.ParentId); rtn.Add(parent); if (document.ParentId != 0) { rtn = rtn.Concat(this.FindPreviousVersions(parent)).ToList(); } } return rtn; }