Exemplo n.º 1
0
        /// <summary>
        /// Creates a specific <see cref="HttpEventAnswer"/> with a predefined pattern used for success status.
        /// </summary>
        /// <param name="e">The source event used for generating the answer</param>
        /// <param name="message">The error message</param>
        /// <returns></returns>
        public static HttpEventAnswer Success(Event e, string message)
        {
            HttpEventStatus status = new HttpEventStatus {
                Code = 200, Message = message
            };

            return(new HttpEventAnswer {
                Parent = e, Data = null, Status = status
            });
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a specific <see cref="HttpEventAnswer"/> with a predefined pattern used for errors.
        /// </summary>
        /// <param name="e">The source event used for generating the answer</param>
        /// <param name="code">The error code</param>
        /// <param name="message">The error message</param>
        /// <returns></returns>
        public static HttpEventAnswer Error(Event e, int code, string message)
        {
            HttpEventStatus status = new HttpEventStatus {
                Code = code, Message = message
            };

            return(new HttpEventAnswer {
                Parent = e, Data = null, Status = status
            });
        }