Exemplo n.º 1
0
        public static string testLogException(VPAEnquiryException exception)
        {
            BsonValue bs = new BsonValue();

            try
            {
                // Open database (or create if not exits)
                using (var db = new LiteDatabase(@"MyData.db"))
                {
                    // Get requests collection
                    var exceptions = db.GetCollection <VPAEnquiryException>("exceptions");


                    // Insert new customer document (Id will be auto-incremented)
                    bs = exceptions.Insert(new VPAEnquiryException()
                    {
                        action    = exception.action,
                        exception = exception.exception,
                        logTime   = exception.logTime,
                        requestId = exception.requestId
                    });
                }
            }
            catch (Exception ex)
            {
            }
            return(bs.ToString());
        }
Exemplo n.º 2
0
 public async Task logException(VPAEnquiryException ex)
 {
     try
     {
         await _requestRepository.AddVPAEnquiryException(new VPAEnquiryException()
         {
             action    = ex.action,
             exception = ex.exception,
             requestId = ex.requestId,
             logTime   = DateTime.Now
         });
     }
     catch (Exception)
     {
     }
 }