public void AddLog(Log logInfo) { using (var context = new LoggingDbContext(_connectionString)) { context.Logs.Add(logInfo); context.SaveChanges(); } }
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(); } }