Esempio n. 1
0
        public ITrendsRunTarget Create(string connectionString, IProject project, trend_categories trendCategory, ITimeService timeService)
        {
            var npgsqlConnectionFactory = new NpgsqlConnectionFactory(connectionString);
            var repositoryFactory = new TrendsRepositoryFactory(
                npgsqlConnectionFactory,
                trendCategory.id,
                trendCategory.trend_tags.Select(t => t.id).ToArray());
            using (var repository = repositoryFactory.Create())
            {
                repository.EnsureTables();
            }

            return new TrendsRunTarget(
                trendCategory,
                new NotificationReporter(timeService) { LifeTime = TimeSpan.FromTicks(0) },
                repositoryFactory,
                project,
                timeService,
                new TrendTableSelector());
        }
Esempio n. 2
0
        public ITrendsRunTarget Create(string connectionString, IProject project, TrendCategory trendCategory, ITimeService timeService)
        {
            var npgsqlConnectionFactory = new NpgsqlConnectionFactory(connectionString);
            var repositoryFactory       = new TrendsRepositoryFactory(
                npgsqlConnectionFactory,
                trendCategory.Id,
                trendCategory.TrendTags.Select(t => t.Id).ToArray());

            using (var repository = repositoryFactory.Create())
            {
                repository.EnsureTables();
            }

            return(new TrendsRunTarget(
                       trendCategory,
                       new NotificationReporter(timeService)
            {
                LifeTime = TimeSpan.FromTicks(0)
            },
                       repositoryFactory,
                       project,
                       timeService,
                       new TrendTableSelector()));
        }