Example #1
0
 public static ApiBusinessExceptionHandler GetInstance()
 {
     if (_instance == null)
     {
         _instance = new ApiBusinessExceptionHandler();
     }
     return(_instance);
 }
        private void FillExceptions()
        {
            Handlers = new List <BaseExceptionErrorHandler>();
            Handlers.Add(ApiBusinessExceptionHandler.GetInstance());
            Handlers.Add(ApiDataExceptionHandler.GetInstance());
            Handlers.Add(ApiExceptionHandler.GetInstance());
            Handlers.Add(DbEntityValidationExceptionHandler.GetInstance());
            Handlers.Add(GenericExceptionHandler.GetInstance());
            BaseExceptionErrorHandler _handler;

            for (int i = 0; i <= Handlers.Count(); i++)
            {
                _handler = Handlers.ElementAt(i);
                if (i + 1 == Handlers.Count())
                {
                    break;
                }
                _handler.Mychainhandler = Handlers.ElementAt(i + 1);
            }
        }