public async Task <ActionResult> NewDoc(string name) { var editUrl = await GraphHelper.CreateDocument(name); if (editUrl != null) { return(Redirect(editUrl)); } else { return(RedirectToAction("Index")); } }