private IList <MetricsEntryBoxMap> GetMetricsEntries(string typename, int id, string metricsName)
        {
            var classifiable = new ClassifiableElementProxy(typename, id);
            var metrics      = _metricsService.GetFor(classifiable);
            var entries      = metrics.FirstOrDefault(m => m.Name == metricsName);

            if (entries == null)
            {
                return(null);
            }

            entryTransformation.Entries = entries.Entries;
            return(entryTransformation.ToBox());
        }
示例#2
0
 public void LoadMetricsIfNull(T entity)
 {
     if (entity != null && entity.Metrics == null)
     {
         entity.Metrics = metricsService.GetFor(entity);
     }
 }