Esempio n. 1
0
 public static MsSqlLoggingEvent Serialize(LoggingEvent loggingEvent)
 {
     var result = new MsSqlLoggingEvent();
     result.EventId = loggingEvent.EventId;
     result.Timestamp = loggingEvent.Timestamp;
     result.Level = loggingEvent.Level;
     result.Value = loggingEvent.Value;
     result.Text = loggingEvent.Text;
     result.Tags = string.Join(" ", loggingEvent.Tags.ToArray());
     result.Data = JsonConvert.SerializeObject(loggingEvent.Data);
     result.User = loggingEvent.User;
     result.Source = loggingEvent.Source;
     return result;
 }
Esempio n. 2
0
 public static LoggingEvent Deserialize(MsSqlLoggingEvent mssqlLoggingEvent)
 {
     var result = new LoggingEvent();
     result.EventId = mssqlLoggingEvent.EventId;
     result.Timestamp = mssqlLoggingEvent.Timestamp;
     result.Level = mssqlLoggingEvent.Level;
     result.Value = mssqlLoggingEvent.Value;
     result.Text = mssqlLoggingEvent.Text;
     result.Tags = Pulsus.Tags.Clean(mssqlLoggingEvent.Tags).ToList();
     result.Data = JsonConvert.DeserializeObject<Dictionary<string, object>>(mssqlLoggingEvent.Data);
     result.User = mssqlLoggingEvent.User;
     result.Source = mssqlLoggingEvent.Source;
     return result;
 }