public List <LoggingDto> GetLogs(DateTime startTime, DateTime endTime, Dictionary <string, string> tags) { var rawResult = this._dbContext.LoggingEntities.Where(x => x.CreateTime > startTime && x.CreateTime < endTime).ToList(); foreach (var pair in tags) { rawResult = rawResult.Where(x => x.Tags.GetValueOrDefault(pair.Key) == pair.Value.ToString()).ToList(); } return(rawResult.Select(x => LoggingDto.CreateFromEntity(x)).ToList()); }
public LoggingDto GetLog(Guid id) { return(LoggingDto.CreateFromEntity(_dbContext.LoggingEntities.First(x => x.Id == id))); }