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); } }
protected override void ApplySampling(TotalRelationStatistics cumulativeData, TotalRelationStatistics newSample) { TotalRelationStatisticsMergeUtility.ApplySample(cumulativeData, newSample); }