public IExecutableCommand MergeStatisticsChain(MergeTotalStoredProcedureStatisticsContext context) { CommandChainCreator chain = new CommandChainCreator(); chain.Add(commands.LoadStatisticsForMergeCommand(context)); chain.Add(commands.MergeStatisticsCommand(context)); chain.Add(commands.SaveMergedStatisticsCommand(context)); return(chain.FirstCommand); }
public IChainableCommand MergeStatisticsCommand(MergeTotalStoredProcedureStatisticsContext context) { return(new MergeStatisticsCommand <uint, TotalStoredProcedureStatistics>(context, () => new TotalStoredProcedureStatisticsSampler(context.DateTimeSelector, null))); }
public IChainableCommand LoadStatisticsForMergeCommand(MergeTotalStoredProcedureStatisticsContext context) { var repository = dalRepositories.GetTotalStoredProcedureStatisticsRepository(); return(new LoadStatisticsForMergeCommand <uint, TotalStoredProcedureStatistics>(context, (from, to) => repository.GetAllGroupedByProcedure(from, to))); }
public IChainableCommand SaveMergedStatisticsCommand(MergeTotalStoredProcedureStatisticsContext context) { var repository = dalRepositories.GetTotalStoredProcedureStatisticsRepository(); return(new SaveMergedStatisticsCommand <uint, TotalStoredProcedureStatistics>(context, x => repository.Remove(x), x => repository.Create(x))); }