示例#1
0
        private void CheckForWarnings <TResult>(TResult result)
        {
            var response = result as IDtoResponseEnvelop;

            if (response == null)
            {
                return;
            }
            var notifier = Container.RequestContext.Notifier;

            if (notifier.HasWarnings)
            {
                IEnumerable <BusinessWarning> warnings = notifier.RetrieveWarnings();
                response.Response.AddBusinessWarnings(warnings);

                StringBuilder strWarnings = new StringBuilder();
                warnings.ToList().ForEach(w => strWarnings.Append(w.Message));
                LoggingFactory.LogWarning(strWarnings.ToString());
            }
        }