コード例 #1
0
 public void AddLog(Log logInfo)
 {
     using (var context = new LoggingDbContext(_connectionString))
     {
         context.Logs.Add(logInfo);
         context.SaveChanges();
     }
 }
コード例 #2
0
        public void AddError(string message)
        {
            using (var context = new LoggingDbContext(_connectionString))
            {
                Log logInfo = new Log()
                {
                    LogLevel = LogLevel.Error.ToString(),
                    Message  = message
                };

                context.Logs.Add(logInfo);
                context.SaveChanges();
            }
        }