public static HandlerExceptions GetInstance()
 {
     if (_handler == null)
     {
         _handler = new HandlerExceptions();
     }
     return(_handler);
 }
        private void FillExceptions()
        {
            Handlers = new List <BaseExceptionHandler>();
            Handlers.Add(ApiBusinessExceptionHandler.GetInstance());
            Handlers.Add(ApiDataExceptionHandler.GetInstance());
            Handlers.Add(ApiExceptionHandler.GetInstance());
            Handlers.Add(DbEntityValidationExceptionHandler.GetInstance());
            Handlers.Add(GenericExceptionHandler.GetInstance());
            BaseExceptionHandler _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);
            }
        }