Esempio n. 1
0
        public static webModel.ProductAssetBase ToWebModel(this moduleModel.ItemAsset asset, IBlobUrlResolver blobUrlResolver)
        {
            webModel.ProductAssetBase retVal = new webModel.ProductImage();
            if (asset.Type == moduleModel.ItemAssetType.File)
            {
                var productAsset = new webModel.ProductAsset();

                productAsset.Name     = HttpUtility.UrlDecode(System.IO.Path.GetFileName(asset.Url));
                productAsset.MimeType = MimeTypeResolver.ResolveContentType(productAsset.Name);

                retVal = productAsset;
            }
            retVal.InjectFrom(asset);
            retVal.Url         = blobUrlResolver.GetAbsoluteUrl(asset.Url);
            retVal.RelativeUrl = asset.Url;
            return(retVal);
        }
Esempio n. 2
0
        public static webModel.ProductAssetBase ToWebModel(this moduleModel.ItemAsset asset, IBlobUrlResolver blobUrlResolver)
        {
            webModel.ProductAssetBase retVal = new webModel.ProductImage();
            if (asset.Type == moduleModel.ItemAssetType.File)
            {
                var productAsset  = new webModel.ProductAsset();

				productAsset.Name = HttpUtility.UrlDecode(System.IO.Path.GetFileName(asset.Url));
				productAsset.MimeType = MimeTypeResolver.ResolveContentType(productAsset.Name);		

				retVal = productAsset;
            }
            retVal.InjectFrom(asset);
			retVal.Url = blobUrlResolver.GetAbsoluteUrl(asset.Url);
			retVal.RelativeUrl = asset.Url;
            return retVal;
        }