public virtual ActionResult Manage(long id) { var account = DocumentSession.Load <WebAccount>(id); if (account == null) { return(Content("Account Not Found")); } var metadata = EntityMetadata.FromRaven(DocumentSession.Advanced.GetMetadataFor(account)); ViewBag.Metadata = metadata; if (!string.IsNullOrWhiteSpace(metadata.LastModifiedBy)) { var modifiedBy = DocumentSession.Load <WebAccount>(metadata.LastModifiedBy); if (modifiedBy != null) { ViewBag.ModifiedBy = modifiedBy; ViewBag.ModifiedById = DocumentSession.GetEntityIdValue(modifiedBy); } } ViewBag.Id = id; return(View(account)); }