/// <summary> /// Initializes a new instance of the <see cref="ExceptionPropertiesBag"/> class. /// </summary> /// <param name="exception">The exception which properties will be added to the bag.</param> /// <param name="filter">Filter that should be applied to each property just before adding it to the bag.</param> public ExceptionPropertiesBag(Exception exception, IExceptionPropertyFilter filter = null) { this.exception = exception ?? throw new ArgumentNullException( nameof(exception), $"Cannot create {nameof(ExceptionPropertiesBag)} for null exception"); this.filter = filter; }
/// <summary> /// Initializes a new instance of the <see cref="ExceptionPropertiesBag"/> class. /// </summary> /// <param name="exception">The exception which properties will be added to the bag.</param> /// <param name="filter">Filter that should be applied to each property just before adding it to the bag.</param> public ExceptionPropertiesBag(Exception exception, IExceptionPropertyFilter filter = null) { this.exception = exception ?? throw new ArgumentNullException(nameof(exception)); this.filter = filter; }
public ExceptionPropertyBag(Exception exception, IExceptionPropertyFilter filter = null) { _exception = exception ?? throw new ArgumentNullException(nameof(exception)); _filter = filter; _properties = new Dictionary <string, object>(); }