예제 #1
0
        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());
        }
예제 #2
0
 public LoggingDto GetLog(Guid id)
 {
     return(LoggingDto.CreateFromEntity(_dbContext.LoggingEntities.First(x => x.Id == id)));
 }