コード例 #1
0
 public void GenerateReports()
 {
     timeSeriesRepository.DeleteAll();
     var map = new Dictionary<string, IBuildSparkline>();
     foreach (var timeSeries in generateTimeSeries.Generate(userEventRepository.GetAll()))
     {
         timeSeriesRepository.Add(timeSeries);
         IBuildSparkline builder;
         if (!map.TryGetValue(timeSeries.Feature, out builder))
             map.Add(timeSeries.Feature, builder = new SparklineBuilder());
         builder.Add(timeSeries.Ticks + timeSeries.Starts);
     }
     foreach (var name in map.Keys)
     {
         var feature = featureRepository.Get(name);
         feature.Sparkline = map[name].Build(SPARKLINE_LENGTH_IN_DAYS);
     }
     context.SaveChanges();
 }
コード例 #2
0
 public SparklineBuilderTest()
 {
     builder = new SparklineBuilder();
 }