Exemple #1
0
        /// <summary>
        /// Set the modify field name and value
        /// </summary>
        /// <param name="fieldName">Field name</param>
        /// <param name="value">Value</param>
        /// <returns>Return the newest modify object</returns>
        public IModify Set(string fieldName, dynamic value)
        {
            var fixedValue = new FixedModifyValue(value);

            AddItem(new SetValueModifyItem(fieldName, fixedValue));
            return(this);
        }
Exemple #2
0
 /// <summary>
 /// Parse modify value
 /// </summary>
 /// <returns></returns>
 public KeyValuePair <string, IModifyValue> ParseModifyValue()
 {
     if (!isParsed)
     {
         string       name  = string.Empty;
         IModifyValue value = null;
         if (Expression != null && Expression.NodeType == ExpressionType.MemberAccess)
         {
             name  = ExpressionHelper.GetExpressionPropertyName(Expression);
             value = new FixedModifyValue(ExpressionHelper.GetExpressionValue(Expression));
         }
         parsedValue = new KeyValuePair <string, IModifyValue>(name, value);
         isParsed    = true;
     }
     return(parsedValue);
 }