internal static IEnumerable <LogFieldModel> Map(ICollection <LogField> fields, Guid logId) { var logFieldModels = new List <LogFieldModel>(); foreach (var logField in fields) { var logFieldModel = new LogFieldModel(); logFieldModel.LogId = logId; logFieldModel.Key = logField.Key; logFieldModel.Value = logField.Value; logFieldModels.Add(logFieldModel); } return(logFieldModels); }
internal static IEnumerable <LogModel> Map(ICollection <Log> logs, string spanId) { var logModels = new List <LogModel>(); foreach (var log in logs) { var logModel = new LogModel(); var logId = Guid.NewGuid(); logModel.LogId = logId; logModel.SpanId = spanId; logModel.Timestamp = log.Timestamp; logModel.Fields = new List <LogFieldModel>(); logModel.Fields.AddRange(LogFieldModel.Map(log.Fields, logId)); logModels.Add(logModel); } return(logModels); }