Ejemplo n.º 1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            // Add framework services.
            services.AddMvc();
            services.AddSingleton <IHttpContextAccessor, HttpContextAccessor>();
            services.AddSingleton <IConfiguration>(Configuration);
            services.AddScoped <ParserWebHelper, ParserWebHelper>(sp => ParserWebHelper.GetHelper(sp));
            services.AddDistributedMemoryCache();
            services.AddMemoryCache();
            services.AddMvcGrid();
            services.AddCors();

            services.AddHttpsRedirection(options =>
            {
                options.RedirectStatusCode = StatusCodes.Status307TemporaryRedirect;
                options.HttpsPort          = 443;
            });

            services.AddSession(options => {
                options.IdleTimeout    = System.TimeSpan.FromMinutes(10);
                options.CookieHttpOnly = true;
            });
        }
Ejemplo n.º 2
0
 //Parser controller dependency injection.
 public ParserControllerViewComponent(ParserWebHelper helper)
 {
     Helper           = helper;
     ParserController = new ParserController();
 }
Ejemplo n.º 3
0
 public HomeController(ParserWebHelper helper)
 {
     Helper = helper;
 }