Beispiel #1
0
        void IErrorLogger.Log(Exception exception)
        {
            try
            {
                var logEntry = new LogEntry
                                   {
                                       Date = DateTime.Now,
                                       Message = exception.Message,
                                       StackTrace = exception.StackTrace,
                                   };

                using (var datacontext = new LogDBDataContext())
                {
                    datacontext.LogEntries.InsertOnSubmit(logEntry);
                    datacontext.SubmitChanges();
                }
            }
            catch (Exception)
            {
                // failed to record exception
            }
        }
Beispiel #2
0
 partial void UpdateLogEntry(LogEntry instance);
Beispiel #3
0
 partial void DeleteLogEntry(LogEntry instance);
Beispiel #4
0
 partial void InsertLogEntry(LogEntry instance);