Пример #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();
        }
Пример #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();
        }
Пример #3
0
 private IUserService CreateUserService()
 {
     return(serviceCreator.CreateUserService());
 }
Пример #4
0
 private IUserService CreateUserService() => serviceCreator.CreateUserService();
Пример #5
0
 private UserService CreateUserService()
 {
     return(serviceCreator.CreateUserService(ConnectionStringResolver.CurrentConnectionString));
 }