public static dataModel.DynamicContentFolder ToDataModel(this coreModel.DynamicContentFolder contentFolder)
		{
			if (contentFolder == null)
				throw new ArgumentNullException("contentFolder");

			var retVal = new dataModel.DynamicContentFolder();
			retVal.InjectFrom(contentFolder);
			return retVal;
		}
Пример #2
0
        /// <summary>
        /// Patch changes
        /// </summary>
        /// <param name="source"></param>
        /// <param name="target"></param>
        public static void Patch(this dataModel.DynamicContentFolder source, dataModel.DynamicContentFolder target)
        {
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }

            var patchInjection = new PatchInjection <dataModel.DynamicContentFolder>(x => x.Name, x => x.Description, x => x.ImageUrl);

            target.InjectFrom(patchInjection, source);
        }
Пример #3
0
        public static dataModel.DynamicContentFolder ToDataModel(this coreModel.DynamicContentFolder contentFolder)
        {
            if (contentFolder == null)
            {
                throw new ArgumentNullException("contentFolder");
            }

            var retVal = new dataModel.DynamicContentFolder();

            retVal.InjectFrom(contentFolder);
            return(retVal);
        }
Пример #4
0
        /// <summary>
        /// Converting to model type
        /// </summary>
        /// <param name="catalogBase"></param>
        /// <returns></returns>
        public static coreModel.DynamicContentFolder ToCoreModel(this dataModel.DynamicContentFolder dbEntity)
        {
            if (dbEntity == null)
            {
                throw new ArgumentNullException("dbEntity");
            }

            var retVal = new coreModel.DynamicContentFolder();

            retVal.InjectFrom(dbEntity);
            if (dbEntity.ParentFolder != null)
            {
                retVal.ParentFolder = dbEntity.ParentFolder.ToCoreModel();
            }
            return(retVal);
        }
        public virtual DynamicContentFolderEntity FromModel(DynamicContentFolder folder, PrimaryKeyResolvingMap pkMap)
        {
            if (folder == null)
            {
                throw new NullReferenceException(nameof(folder));
            }

            pkMap.AddPair(folder, this);

            Id             = folder.Id;
            CreatedBy      = folder.CreatedBy;
            CreatedDate    = folder.CreatedDate;
            Description    = folder.Description;
            ModifiedBy     = folder.ModifiedBy;
            ModifiedDate   = folder.ModifiedDate;
            Name           = folder.Name;
            ParentFolderId = folder.ParentFolderId;

            return(this);
        }
        public virtual DynamicContentFolder ToModel(DynamicContentFolder folder)
        {
            if (folder == null)
            {
                throw new NullReferenceException(nameof(folder));
            }

            folder.Id             = Id;
            folder.CreatedBy      = CreatedBy;
            folder.CreatedDate    = CreatedDate;
            folder.Description    = Description;
            folder.ModifiedBy     = ModifiedBy;
            folder.ModifiedDate   = ModifiedDate;
            folder.Name           = Name;
            folder.ParentFolderId = ParentFolderId;

            if (ParentFolder != null)
            {
                folder.ParentFolder = ParentFolder.ToModel(AbstractTypeFactory <DynamicContentFolder> .TryCreateInstance());
            }
            return(folder);
        }