Access the friendly URL of a content Item
Version: 9.2
You can use the Sitecore.Links.LinkManager.GetItemUrl()
method to access the friendly URL of a content item. For example, to access the friendly URL of the /Sitecore/Content/Home item in the Master database:
RequestResponse
Sitecore.Data.Database master = Sitecore.Configuration.Factory.GetDatabase("master");
Sitecore.Data.Items.Item home = master.GetItem("/sitecore/content/home");
string url = Sitecore.Links.LinkManager.GetItemUrl(home);