/// <summary>
		/// Converting to model type
		/// </summary>
		/// <param name="catalogBase"></param>
		/// <returns></returns>
		public static coreModel.PricelistAssignment ToCoreModel(this dataModel.PricelistAssignment dbEntity)
		{
			if (dbEntity == null)
				throw new ArgumentNullException("dbEntity");

			var retVal = new coreModel.PricelistAssignment();
			retVal.InjectFrom(dbEntity);
			return retVal;

		}
        /// <summary>
        /// Converting to model type
        /// </summary>
        /// <param name="catalogBase"></param>
        /// <returns></returns>
        public static coreModel.PricelistAssignment ToCoreModel(this dataModel.PricelistAssignment dbEntity)
        {
            if (dbEntity == null)
            {
                throw new ArgumentNullException("dbEntity");
            }

            var retVal = new coreModel.PricelistAssignment();

            retVal.InjectFrom(dbEntity);
            return(retVal);
        }
		public static coreModel.PricelistAssignment ToCoreModel(this webModel.PricelistAssignment assignment)
		{
			var retVal = new coreModel.PricelistAssignment();
			retVal.InjectFrom(assignment);

			var conditionExpression = assignment.DynamicExpression.GetConditionExpression();
			retVal.ConditionExpression = SerializationUtil.SerializeExpression(conditionExpression);

			//Clear availableElements in expression (for decrease size)
			assignment.DynamicExpression.AvailableChildren = null;
			var allBlocks = ((DynamicExpression)assignment.DynamicExpression).Traverse(x => x.Children);
			foreach (var block in allBlocks)
			{
				block.AvailableChildren = null;
			}
			retVal.PredicateVisualTreeSerialized = JsonConvert.SerializeObject(assignment.DynamicExpression);

			return retVal;
		}
Exemplo n.º 4
0
        public static coreModel.PricelistAssignment ToCoreModel(this webModel.PricelistAssignment assignment)
        {
            var retVal = new coreModel.PricelistAssignment();

            retVal.InjectFrom(assignment);

            var conditionExpression = assignment.DynamicExpression.GetConditionExpression();

            retVal.ConditionExpression = SerializationUtil.SerializeExpression(conditionExpression);

            //Clear availableElements in expression (for decrease size)
            assignment.DynamicExpression.AvailableChildren = null;
            var allBlocks = ((DynamicExpression)assignment.DynamicExpression).Traverse(x => x.Children);

            foreach (var block in allBlocks)
            {
                block.AvailableChildren = null;
            }
            retVal.PredicateVisualTreeSerialized = JsonConvert.SerializeObject(assignment.DynamicExpression);

            return(retVal);
        }