Esempio n. 1
0
        internal static Response <R> SafeExecutor <R>(this bUtility.ExceptionHandler exceptionHandler, Func <R> action) where R : class
        {
            var r = exceptionHandler.HandleException(action);

            SetGenericError(r?.Item2);
            return(new Response <R> {
                Payload = r.Item1, Exception = r.Item2
            });
        }
 public MyFirstController(ILogger logger, IMyFistrService myFistrService)
 {
     _logger           = logger;
     _myFirstService   = myFistrService;
     _exceptionHandler = new bUtility.ExceptionHandler(logger, ex => (ex as MyFirstException)?.CodeWithPrefix, typeof(MyFirstException));
 }
 public BookstoreController(ILogger logger, IBookstoreService bookstoreService)
 {
     _logger           = logger;
     _bookstoreService = bookstoreService;
     _exceptionHandler = new bUtility.ExceptionHandler(logger, ex => (ex as BookstoreException)?.CodeWithPrefix, typeof(BookstoreException));
 }