예제 #1
0
        public static coreModel.Asset ToCoreModel(this webModel.Asset asset)
        {
            var retVal = new coreModel.Asset();

            retVal.InjectFrom(asset);
            retVal.Url = asset.RelativeUrl;
            return(retVal);
        }
예제 #2
0
		public static webModel.Asset ToWebModel(this coreModel.Asset asset, IBlobUrlResolver blobUrlResolver)
		{
			var retVal = new webModel.Asset();
			retVal.InjectFrom(asset);
			if (asset.Name == null)
			{
				retVal.Name = HttpUtility.UrlDecode(System.IO.Path.GetFileName(asset.Url));
			}
			if (asset.MimeType == null)
			{
				retVal.MimeType = MimeTypeResolver.ResolveContentType(asset.Name);
			}
			if (blobUrlResolver != null)
			{
				retVal.Url = blobUrlResolver.GetAbsoluteUrl(asset.Url);
			}
			retVal.RelativeUrl = asset.Url;
			return retVal;
		}
예제 #3
0
        public static webModel.Asset ToWebModel(this coreModel.Asset asset, IBlobUrlResolver blobUrlResolver)
        {
            var retVal = new webModel.Asset();

            retVal.InjectFrom(asset);
            if (asset.Name == null)
            {
                retVal.Name = HttpUtility.UrlDecode(System.IO.Path.GetFileName(asset.Url));
            }
            if (asset.MimeType == null)
            {
                retVal.MimeType = MimeTypeResolver.ResolveContentType(asset.Name);
            }
            if (blobUrlResolver != null)
            {
                retVal.Url = blobUrlResolver.GetAbsoluteUrl(asset.Url);
            }
            retVal.RelativeUrl = asset.Url;
            return(retVal);
        }