Esempio n. 1
0
 public static ApiDataExceptionHandler GetInstance()
 {
     if (_instance == null)
     {
         _instance = new ApiDataExceptionHandler();
     }
     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);
            }
        }