Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AutoResponseHttpResponseExceptionMapperBase"/> class.
        /// </summary>
        /// <param name="formatter">The formatter.</param>
        protected AutoResponseHttpResponseExceptionMapperBase(IAutoResponseHttpResponseFormatter formatter)
        {
            this.formatter = formatter ?? throw new ArgumentNullException(nameof(formatter));

            this.mappers = new Lazy <IDictionary <ErrorRegistration, Func <ResponseContent, HttpResponseExceptionContext, Exception> > >(() =>
            {
                var mappersInstance = new Dictionary <ErrorRegistration, Func <ResponseContent, HttpResponseExceptionContext, Exception> >(
                    new ErrorRegistrationEqualityComparer());
                this.ConfigureMappings(new HttpResponseExceptionConfiguration(mappersInstance));
                return(mappersInstance);
            });
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AutoResponseHttpResponseExceptionMapper"/> class.
 /// </summary>
 /// <param name="formatter">The formatter.</param>
 public AutoResponseHttpResponseExceptionMapper(IAutoResponseHttpResponseFormatter formatter)
     : base(formatter)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="HttpResponseExceptionContext"/> class.
 /// </summary>
 /// <param name="formatter">The formatter.</param>
 public HttpResponseExceptionContext(IAutoResponseHttpResponseFormatter formatter)
 {
     this.Formatter = formatter ?? throw new ArgumentNullException(nameof(formatter));
 }