Пример #1
0
        /// <summary>
        /// Start defining exception filtering rules for a certain exception type
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public ExceptionTransform <T> IfExceptionIs <T>() where T : Exception
        {
            var transform = _transforms.OfType <ExceptionTransform <T> >().FirstOrDefault();

            if (transform == null)
            {
                transform = new ExceptionTransform <T>();
                _transforms.Add(transform);
            }

            return(transform);
        }
Пример #2
0
 public FilterRule(Func <T, bool> filter, ExceptionTransform <T> parent)
 {
     Filter  = filter;
     _parent = parent;
 }