public static SwarmopsLogEntry CreateEntry(Person person, IXmlPayload logEntry) { string logEntryClass = logEntry.GetType().ToString(); if (logEntryClass.StartsWith("Swarmops.Logic.Support.LogEntries.")) { logEntryClass = logEntryClass.Substring("Swarmops.Logic.Support.LogEntries.".Length); } int logEntryId = SwarmDb.GetDatabaseForWriting().CreateSwarmopsLogEntry( person != null ? person.Identity : 0, logEntryClass, logEntry.ToXml()); return(SwarmopsLogEntry.FromIdentityAggressive(logEntryId)); }
public static SwarmopsLogEntry Create(Person person, IXmlPayload logEntry, params object[] affectedObjects) { SwarmopsLogEntry entry = SwarmopsLog.CreateEntry(person, logEntry); if (person != null) { entry.CreateAffectedObject(person); } foreach (IHasIdentity affectedObject in affectedObjects) { entry.CreateAffectedObject(affectedObject); } return(entry); }