Exemplo n.º 1
0
        //-----------------------------------------------------------
        // convenience methods
        //-----------------------------------------------------------

        /// <summary>
        /// Merge source values (messages, exceptions, etc) into this reply setting status to most severe
        /// </summary>
        /// <param name="source">Values to be merged into this reply</param>
        /// <returns>Reference to this object with content merged</returns>
        public virtual ActionReply Merge(ActionReply source)
        {
            foreach (var msg in source.Messages)
            {
                this.Messages.Add(msg);
            }

            this.Status        = source.Status;
            this.CorrelationId = source.CorrelationId;
            this.Value         = source.Value ?? this.Value;

            foreach (var kvp in source)
            {
                this.Add(kvp);
            }
            return(this);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Copy constructor
 /// </summary>
 /// <param name="result">Source to copy</param>
 public ActionReply(ActionReply result)
     : this()
 {
     Value = result.Value;
 }