Exemple #1
0
        static void Main(string[] args)
        {
            ServiceCreator creator = new ServiceCreator(
                new ApplicationContext(),
                new Mapper(new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(new AutoMapperProfile());
            }))
                );

            var repo = new ElasticRepository(
                creator.CreateCategorieService(_connectionString),
                creator.CreateNewsService(_connectionString),
                creator.CreateUserService(_connectionString)
                );

            repo.SaveDocumentToElasticsearch().GetAwaiter().GetResult();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            AutomapperConfig.Configure();
            Logger.InitLogger();

            ServiceCreator creator = new ServiceCreator(
                new ApplicationContext(),
                new Mapper(new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(new AutoMapperProfile());
            }))
                );

            RSSFeeder feeder = new RSSFeeder(
                new RemoteLoaderFeed(),
                creator.CreateCategorieService(_connectionString),
                creator.CreateNewsService(_connectionString),
                creator.CreateFeederService(_connectionString),
                creator.CreateUserService(_connectionString));

            feeder.Run().GetAwaiter().GetResult();
        }