Esempio n. 1
0
        /// <summary>
        /// Creates the response.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="info">The information.</param>
        /// <param name="messageId">The message identifier.</param>
        /// <returns></returns>
        private T CreateResponse <T>(InfoAccumulator info, Guid messageId) where T : CommandResponseBase, new()
        {
            var response = new T {
                MessageId = messageId,
                Errors    = info.GetErrors()
                            .Concat(info.GetExceptions()
                                    .Select(e => e.ToString()))
                            .ToArray(),
                Warnings = info.GetWarning()
                           .ToArray(),
                Infos = info.GetInfo()
                        .ToArray()
            };

            return(response);
        }