Esempio n. 1
0
        /// <summary>
        /// Patch changes
        /// </summary>
        /// <param name="source"></param>
        /// <param name="target"></param>
        public static void Patch(this dataModel.Image source, dataModel.Image target)
        {
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }

            var patchInjectionPolicy = new PatchInjection <dataModel.Image>(x => x.LanguageCode, x => x.Name, x => x.SortOrder);

            target.InjectFrom(patchInjectionPolicy, source);
        }
Esempio n. 2
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;
		}
Esempio n. 3
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);
        }
Esempio n. 4
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);
        }
		/// <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;
		}
Esempio n. 6
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);
        }
        /// <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);
        }