static void Main(string[] args)
        {
            var container = SimpleInjectorContainer.Initialize();

            IVenueService    venueService    = container.GetInstance <IVenueService>();
            ILocationService locationService = container.GetInstance <ILocationService>();
            InstagramScraper bot             = container.GetInstance <InstagramScraper>();

            bot.Initialize();
            bot.Login();
            var venues            = venueService.GetAll();
            var exceptionMessages = new List <string>();

            foreach (var venue in venues)
            {
                try
                {
                    venue.Location = locationService.GetByVenueId(venue.Id);
                    bot.FindVisitorByVenue(venue);
                    venueService.InsertVisitors(venue);
                }
                catch (Exception ex)
                {
                    exceptionMessages.Add(string.Format("Mensage: {0} --> InnerException: {1} --> VenueId: {2} --> VenueName: {3}", ex.Message, ex.InnerException, venue.Id, venue.Name));
                }
            }
            System.IO.File.WriteAllLines(ConfigurationManager.AppSettings.Get("FilesPath"), exceptionMessages);
            bot.Close();
        }
Beispiel #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Application.Run(SimpleInjectorContainer.Initialize());
        }
Beispiel #3
0
 /// <summary>
 ///Método de execução de rotinas durante a inicialização da API
 /// </summary>
 protected void Application_Start(object sender, EventArgs e)
 {
     // Realiza as configurações gerais da API
     GlobalConfiguration.Configure(WebApiConfig.Register);
     SimpleInjectorContainer.Initialize();
     AutoMapperInitializer.Initialize();
 }
Beispiel #4
0
        protected void Application_Start()
        {
            GlobalConfiguration.Configure(WebApiConfig.Register);

            AutoMapperInitializer.Initialize();
            SimpleInjectorContainer.Initialize();
        }
 public void EnviarLoteParaLeituraEValidacao(List <String> arquivos)
 {
     foreach (var arquivo in arquivos)
     {
         var task = SimpleInjectorContainer.Initialize();
         task.TaskLeitura(CaminhoPastaDeVendas + "\\" + arquivo, arquivo);
     }
 }
Beispiel #6
0
        public void Configuration(IAppBuilder app)
        {
            GlobalConfiguration.Configure(WebApiConfig.Register);
            SimpleInjectorContainer.Initialize();
            HttpConfiguration config = new HttpConfiguration();

            app.UseCors(CorsOptions.AllowAll);
            OAuthConfig.ConfigureOAuth(app);
            app.UseWebApi(config);
        }
Beispiel #7
0
        /// <summary>
        /// Initializes DI container and binds all dependencies
        /// </summary>
        /// <returns>The DI container instance</returns>
        public static Container InitializeDI()
        {
            var container = SimpleInjectorContainer.Initialize();

            CoreBootstrapper.BindDependencies();
            RedisBootstrapper.BindDependencies();
            ApiMockBootstrapper.BindDependencies();

            AssemblyBinder.BindAssemby(typeof(AppBootstrapper).Assembly);
            container.Container.Register <IRedisConfiguration>(RedisConfig.Read, Lifestyle.Singleton);
            return(container.Container);
        }
        public void Configuration(IAppBuilder app)
        {
            SimpleInjectorContainer.Initialize();

            HttpConfiguration config = new HttpConfiguration();

            config.MapHttpAttributeRoutes();
            config.Routes.MapHttpRoute(name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional });
            EnableOdata(config);
            ConfigureCors(app);
            ActiveAccessTokens(app);
            app.UseWebApi(config);

            AutoMapperConfig.Initialize();


            config.DependencyResolver = new SimpleInjectorWebApiDependencyResolver(SimpleInjectorContainer.container);
        }
Beispiel #9
0
 protected void Application_Start(object sender, EventArgs e)
 {
     GlobalConfiguration.Configure(WebApiConfig.Registrar);
     SimpleInjectorContainer.Initialize();
     InicializadorAutoMapper.Inicializar();
 }
Beispiel #10
0
 protected void Application_Start(object sender, EventArgs e)
 {
     SimpleInjectorContainer.Initialize();
 }
Beispiel #11
0
 private static void InitializeContainer(Container container)
 {
     SimpleInjectorContainer.Initialize(container, Lifestyle.Singleton);
 }