public static coreModel.Image ToCoreModel(this webModel.Image image)
        {
            var retVal = new coreModel.Image();

            retVal.InjectFrom(image);
            retVal.Url = image.RelativeUrl;
            return(retVal);
        }
Beispiel #2
0
        public static webModel.Image ToWebModel(this coreModel.Image image, IBlobUrlResolver blobUrlResolver)
        {
            var retVal = new webModel.Image();

            retVal.InjectFrom(image);
            if (blobUrlResolver != null)
            {
                retVal.Url = blobUrlResolver.GetAbsoluteUrl(image.Url);
            }
            retVal.RelativeUrl = image.Url;
            return(retVal);
        }
        public static webModel.Image ToWebModel(this coreModel.Image image, IBlobUrlResolver blobUrlResolver)
        {
            var retVal = new webModel.Image();

			retVal.InjectFrom(image);
			if (blobUrlResolver != null)
			{
				retVal.Url = blobUrlResolver.GetAbsoluteUrl(image.Url);
			}
			retVal.RelativeUrl = image.Url;
            return retVal;
        }
        public static webModel.Image ToWebModel(this coreModel.Image image, IBlobUrlResolver blobUrlResolver)
        {
            var retVal = new webModel.Image();

            //Do not use omu.InjectFrom for performance reasons
            retVal.Group        = image.Group;
            retVal.Id           = image.Id;
            retVal.LanguageCode = image.LanguageCode;
            retVal.Name         = image.Name;
            retVal.IsInherited  = image.IsInherited;
            retVal.SortOrder    = image.SortOrder;

            if (blobUrlResolver != null)
            {
                retVal.Url = blobUrlResolver.GetAbsoluteUrl(image.Url);
            }
            retVal.RelativeUrl = image.Url;
            return(retVal);
        }