internal ExceptionOptions Build()
        {
            var typedict = new Dictionary <Type, ExceptonTypeModel>();

            foreach (var item in typeList)
            {
                typedict[item.Item1] = item.Item2;
            }
            var codedict = new Dictionary <Type, ExceptonCodeModel>();

            foreach (var item in codeList)
            {
                if (typedict.ContainsKey(item.Item1))
                {
                    continue;
                }
                codedict[item.Item1] = item.Item2;
            }
            var options = new ExceptionOptions()
            {
                ExceptionTypes = typedict,
                ExceptionCodes = codedict,
                EnableLogger   = exceptionLogger
            };

            return(options);
        }
예제 #2
0
 public ExceptionManagement(ExceptionOptions options)
 {
     exceptionTypes = options.ExceptionTypes;
     exceptionCodes = options.ExceptionCodes;
     enableLogger   = options.EnableLogger;
 }