private List <Timing> LoadChildrenTimings(Guid parentId) { var childrenTimings = Timings.Find(Query <TimingPoco> .EQ(poco => poco.ParentTimingId, parentId)) .SetSortOrder(SortBy <TimingPoco> .Ascending(poco => poco.StartMilliseconds)) .ToList() .Select(TimingPocoToTiming) .ToList(); childrenTimings.ForEach(timing => { timing.Children = LoadChildrenTimings(timing.Id); timing.CustomTimings = LoadCustomTimings(timing.Id); }); return(childrenTimings); }
private List <Timing> LoadTimings(Guid profilerId) { var timings = new List <Timing>(); var query = Query.EQ("MiniProfilerId", profilerId.ToString()); var timingPocos = Timings.Find(query).ToList(); foreach (var poco in timingPocos) { timings.Add(new Timing { Id = Guid.Parse(poco.Id), ParentTimingId = poco.ParentTimingId == null ? (Guid?)null : Guid.Parse(poco.ParentTimingId), Name = poco.Name, StartMilliseconds = (decimal)poco.StartMilliseconds, DurationMilliseconds = (decimal?)poco.DurationMilliseconds }); } return(timings); }