I'm using Umbraco with Lucene and Examine
I'm trying to get the url of a image but at the moment I get the following "umb://media/57ad107794724d0289b4f9fe44c298a8"
How can I get the URL for the media from the UDI, my code attempt so far is below.
foreach (var item in searchResults)
{
var content = Umbraco.Content(item.Fields["id"]);
if (item.Fields.Keys.Contains("image"))
{
var image = item.Fields["image"].Split(new[] {","}, StringSplitOptions.RemoveEmptyEntries);
var pathToImage = string.Join(",", image);
var mediaItem = Umbraco.TypedContent(pathToImage);
var test3 = mediaItem.Url; <--------------------Throws NullReferenceException
}
}
Any help appreciated