// 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; }); }
//Parser controller dependency injection. public ParserControllerViewComponent(ParserWebHelper helper) { Helper = helper; ParserController = new ParserController(); }
public HomeController(ParserWebHelper helper) { Helper = helper; }