internal ExceptionOptions Build()
        {
            var typedict = new Dictionary <Type, Func <ExceptionContext, Exception, ResultModel> >();

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

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

            return(options);
        }
Exemple #2
0
 public ExceptionManagement(ExceptionOptions options)
 {
     exceptionTypes = options.ExceptionTypes;
     exceptionCodes = options.ExceptionCodes;
 }