Exemplo n.º 1
0
 public SpaSsrController(ILogger <SpaSsrController> logger, IHttpClientFactory httpClientFactory, IHostingEnvironment env, IOptions <HypernovaSettings> options, IDistributedCache cache)
 {
     _logger            = logger ?? throw new ArgumentNullException(nameof(logger));
     _env               = env ?? throw new ArgumentNullException(nameof(env));
     _httpClientFactory = httpClientFactory ?? throw new ArgumentNullException(nameof(httpClientFactory));
     _options           = options;
     _settings          = options.Value;
     _cache             = cache;
 }
Exemplo n.º 2
0
        public StoryController(ILogger <StoryController> logger, IHostingEnvironment env, IHttpClientFactory httpClientFactory, IOptions <HypernovaSettings> options, IDistributedCache cache)
        {
            _settings = options.Value;
            _cache    = cache;

            var siteUrl = $"{HttpContext.Request.Scheme}://{HttpContext.Request.Host}";

            _hypernovaClient = new HypernovaClient(logger, env, httpClientFactory, options, siteUrl);
            _contentRoot     = env.ContentRootPath;
            var settings = options.Value;
        }