public static webModel.PropertyAttribute ToWebModel(this moduleModel.PropertyAttribute attribute)
        {
            var retVal = new webModel.PropertyAttribute();

            retVal.InjectFrom(attribute);
            return(retVal);
        }
        /// <summary>
        /// Converting to foundation type
        /// </summary>
        /// <param name="catalog"></param>
        /// <returns></returns>
        public static dataModel.PropertyAttribute ToDataModel(this coreModel.PropertyAttribute attribute)
        {
            var retVal = new dataModel.PropertyAttribute();

            retVal.InjectFrom(attribute);

            retVal.PropertyAttributeName  = attribute.Name;
            retVal.PropertyAttributeValue = attribute.Value;
            return(retVal);
        }
Exemplo n.º 3
0
        public static webModel.PropertyAttribute ToWebModel(this moduleModel.PropertyAttribute attribute)
        {
            var retVal = new webModel.PropertyAttribute();

            retVal.Id    = attribute.Id;
            retVal.Name  = attribute.Name;
            retVal.Value = attribute.Value;


            return(retVal);
        }
		/// <summary>
		/// Converting to model type
		/// </summary>
		/// <param name="catalogBase"></param>
		/// <returns></returns>
		public static coreModel.PropertyAttribute ToCoreModel(this dataModel.PropertyAttribute dbAttribute, coreModel.Property property)
		{
			if (property == null)
				throw new ArgumentNullException("dbProperty");

			var retVal = new coreModel.PropertyAttribute();
			retVal.InjectFrom(dbAttribute);

			retVal.Name = dbAttribute.PropertyAttributeName;
			retVal.Value = dbAttribute.PropertyAttributeValue;
			retVal.PropertyId = property.Id;
			retVal.Property = property;
			
			return retVal;
		}
        /// <summary>
        /// Converting to foundation type
        /// </summary>
        /// <param name="catalog"></param>
        /// <returns></returns>
        public static dataModel.PropertyAttribute ToDataModel(this coreModel.PropertyAttribute attribute)
        {
            var retVal = new dataModel.PropertyAttribute();
            var id     = retVal.Id;

            retVal.InjectFrom(attribute);
            if (attribute.Id == null)
            {
                retVal.Id = id;
            }

            retVal.PropertyAttributeName  = attribute.Name;
            retVal.PropertyAttributeValue = attribute.Value;
            return(retVal);
        }
        /// <summary>
        /// Converting to model type
        /// </summary>
        /// <param name="catalogBase"></param>
        /// <returns></returns>
        public static coreModel.PropertyAttribute ToCoreModel(this dataModel.PropertyAttribute dbAttribute, coreModel.Property property)
        {
            if (property == null)
            {
                throw new ArgumentNullException("dbProperty");
            }

            var retVal = new coreModel.PropertyAttribute();

            retVal.InjectFrom(dbAttribute);

            retVal.Name       = dbAttribute.PropertyAttributeName;
            retVal.Value      = dbAttribute.PropertyAttributeValue;
            retVal.PropertyId = property.Id;
            retVal.Property   = property;

            return(retVal);
        }
		public static moduleModel.PropertyAttribute ToModuleModel(this webModel.PropertyAttribute attribute)
		{
			var retVal = new moduleModel.PropertyAttribute();
			retVal.InjectFrom(attribute);
			return retVal;
		}