Пример #1
0
 private static KeyValuePair <int, object> TryCatch(Func <KeyValuePair <int, object> > func)
 {
     try { return(func()); }
     catch (ApplicationException ae)
     {
         var msgDetail = new MessageDetail(ae.Message, ae.StackTrace);
         return(ActionUtils.Failure(msgDetail));
     }
     catch (Exception e)
     {
         var msgDetail = new MessageDetail(e.Message, e.StackTrace);
         return(ActionUtils.Failure(msgDetail));
     }
 }
Пример #2
0
 private static KeyValuePair <int, object> TryCatch <T1, T2, T3, T4, T5>(Func <T1, T2, T3, T4, T5, KeyValuePair <int, object> > func, T1 param1, T2 param2, T3 param3, T4 param4, T5 param5)
 {
     try { return(func(param1, param2, param3, param4, param5)); }
     catch (ApplicationException ae) { return(ActionUtils.Failure(new MessageDetail(ae.Message, ae.StackTrace))); }
     catch (Exception e) { return(ActionUtils.Failure(new MessageDetail(e.Message, e.StackTrace))); }
 }
Пример #3
0
 private static KeyValuePair <int, object> TryCatch <T1>(Func <T1, KeyValuePair <int, object> > func, T1 param1)
 {
     try { return(func(param1)); }
     catch (ApplicationException ae) { return(ActionUtils.Failure(new MessageDetail(ae.Message, ae.StackTrace))); }
     catch (Exception e) { return(ActionUtils.Failure(new MessageDetail(e.Message, e.StackTrace))); }
 }