void ISessionFacade.Log(LogEntry[] entries, ISession session) { if ((entries == null) || (entries.Count() == 0)) { throw new ArgumentNullException("entry"); } if (session == null) { throw new ArgumentNullException("session"); } if (session.id == 0) { throw new ArgumentException("session must be created first"); } foreach (LogEntry l in entries) { Log newEntry = new Log() { createDT = DateTime.UtcNow , entry = l.ToString() , logTypeID = l.LogTypeID , referenceKey = l.Reference , sessionID = session.id , severity = (int)l.Level }; this.LogRepo.Insert(newEntry); } this.Dimension.SaveChanges(); }
void ISessionFacade.Log(LogEntry entry, ISession session) { if (entry == null) { throw new ArgumentNullException("entry"); } if (session == null) { throw new ArgumentNullException("session"); } if (session.id == 0) { throw new ArgumentException("session must be created first"); } Log newEntry = new Log() { createDT = DateTime.UtcNow , entry = entry.ToString() , logTypeID = entry.LogTypeID , referenceKey = entry.Reference , sessionID = session.id , severity = (int)entry.Level }; this.LogRepo.Insert(newEntry); this.Dimension.SaveChanges(); }