Ejemplo n.º 1
0
        public string getImageURLFromUDI(string imageUDI)
        {
            try {
                var umbracoHelper = new Umbraco.Web.UmbracoHelper(Umbraco.Web.UmbracoContext.Current);

                var imageGuidUdi = GuidUdi.Parse(imageUDI);
                var imageNodeID  = ApplicationContext.Current.Services.EntityService.GetIdForKey(imageGuidUdi.Guid, (UmbracoObjectTypes)Enum.Parse(typeof(UmbracoObjectTypes), imageGuidUdi.EntityType, true));
                var imageNode    = umbracoHelper.TypedMedia(imageNodeID.Result);

                return(imageNode.Url);
            }
            catch { return(""); }
        }