public string GetDocumentUrl(object entity) { DocumentMetadata value; if (entitiesAndMetadata.TryGetValue(entity, out value) == false) { throw new InvalidOperationException("Could not figure out identifier for transient instance"); } return(AsyncDatabaseCommands.UrlFor(value.Key)); }