public static coreModel.Image ToCoreModel(this webModel.Image image)
        {
            var retVal = new coreModel.Image();
			retVal.InjectFrom(image);
			retVal.Url = image.RelativeUrl;
            return retVal;
        }
        public static coreModel.Image ToCoreModel(this webModel.Image image)
        {
            var retVal = new coreModel.Image();

            retVal.InjectFrom(image);
            retVal.Url = image.RelativeUrl;
            return(retVal);
        }
		/// <summary>
		/// Converting to model type
		/// </summary>
		/// <param name="catalogBase"></param>
		/// <returns></returns>
		public static coreModel.Image ToCoreModel(this dataModel.Image dbImage)
		{
			if (dbImage == null)
				throw new ArgumentNullException("dbImage");

			var retVal = new coreModel.Image();

			retVal.InjectFrom(dbImage);
			return retVal;

		}
Exemple #4
0
        /// <summary>
        /// Converting to model type
        /// </summary>
        /// <param name="catalogBase"></param>
        /// <returns></returns>
        public static coreModel.Image ToCoreModel(this dataModel.Image dbImage)
        {
            if (dbImage == null)
            {
                throw new ArgumentNullException("dbImage");
            }

            var retVal = new coreModel.Image();

            retVal.InjectFrom(dbImage);
            return(retVal);
        }
Exemple #5
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 moduleModel.Image image, IBlobUrlResolver blobUrlResolver)
        {
            var retVal = new webModel.Image();

            retVal.InjectFrom(image);
            retVal.Src      = blobUrlResolver.GetAbsoluteUrl(image.Url);
            retVal.ThumbSrc = retVal.Src;
            if (retVal.Name == null)
            {
                retVal.Name = retVal.Group;
            }
            return(retVal);
        }
Exemple #7
0
        /// <summary>
        /// Converting to foundation type
        /// </summary>
        public static dataModel.Image ToDataModel(this coreModel.Image image, PrimaryKeyResolvingMap pkMap)
        {
            if (image == null)
            {
                throw new ArgumentNullException("image");
            }

            var retVal = new dataModel.Image();

            pkMap.AddPair(image, retVal);
            retVal.InjectFrom(image);

            return(retVal);
        }
Exemple #8
0
        /// <summary>
        /// Converting to foundation type
        /// </summary>
        public static dataModel.Image ToDataModel(this coreModel.Image image)
        {
            if (image == null)
            {
                throw new ArgumentNullException("image");
            }

            var retVal = new dataModel.Image();
            var id     = retVal.Id;

            retVal.InjectFrom(image);
            if (image.Id == null)
            {
                retVal.Id = id;
            }
            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);
        }
        /// <summary>
        /// Converting to model type
        /// </summary>
        /// <param name="catalogBase"></param>
        /// <returns></returns>
        public static coreModel.Image ToCoreModel(this dataModel.Image dbImage)
        {
            if (dbImage == null)
            {
                throw new ArgumentNullException("dbImage");
            }

            var retVal = new coreModel.Image();

            //Do not use omu.ValueInjector for performance purposes
            retVal.CreatedBy    = dbImage.CreatedBy;
            retVal.CreatedDate  = dbImage.CreatedDate;
            retVal.Id           = dbImage.Id;
            retVal.Group        = dbImage.Group;
            retVal.LanguageCode = dbImage.LanguageCode;
            retVal.ModifiedBy   = dbImage.ModifiedBy;
            retVal.ModifiedDate = dbImage.ModifiedDate;
            retVal.Name         = dbImage.Name;
            retVal.SortOrder    = dbImage.SortOrder;
            retVal.Url          = dbImage.Url;

            return(retVal);
        }