Esempio n. 1
0
        public string Update()
        {
            if (LastUpdate.Minute <= DateTime.Now.Minute - 1 && LastUpdate.Hour == DateTime.Now.Hour)
            {
                LastUpdate = DateTime.Now;
                updateDB.UpdateDb(update.Update());
                return("Get last news");
            }
            else if (LastUpdate.Hour != DateTime.Now.Hour)
            {
                LastUpdate = DateTime.Now;
                updateDB.UpdateDb(update.Update());
                return("Get last news");
            }

            return("");
        }
Esempio n. 2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, src.IUpdateNews updateNews, src.IUpdateDB updateDB)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseStaticFiles();

            app.UseMvc(e =>
            {
                e.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });

            app.UseAuthentication();

            updateDB.UpdateDb(updateNews.Update());
        }