Ejemplo n.º 1
0
        private void PersistTotalRelationStatistics(TotalRelationStatistics newStatistics)
        {
            var repository = repositories.GetTotalRelationStatisticsRepository();
            var uniqueKey  = new TotalRelationStatisticsUniqueKey()
            {
                DatabaseID = newStatistics.DatabaseID,
                Date       = newStatistics.Date,
                RelationID = newStatistics.RelationID
            };
            var oldStatistics = repository.GetByUniqueKey(uniqueKey);

            if (oldStatistics == null)
            {
                repository.Create(newStatistics);
            }
            else
            {
                TotalRelationStatisticsMergeUtility.ApplySample(oldStatistics, newStatistics);
                repository.Update(oldStatistics);
            }
        }
Ejemplo n.º 2
0
 protected override void ApplySampling(TotalRelationStatistics cumulativeData, TotalRelationStatistics newSample)
 {
     TotalRelationStatisticsMergeUtility.ApplySample(cumulativeData, newSample);
 }