Converted to IOptions over IOptionsSnapshot due to the latter only working in scoped services.
Further amends to return to booting application.
This commit is contained in:
@@ -6,7 +6,7 @@ namespace Umbraco.Web.Common.AspNetCore
|
||||
{
|
||||
public class AspNetCoreBackOfficeInfo : IBackOfficeInfo
|
||||
{
|
||||
public AspNetCoreBackOfficeInfo(IOptionsSnapshot<GlobalSettings> globalSettings)
|
||||
public AspNetCoreBackOfficeInfo(IOptions<GlobalSettings> globalSettings)
|
||||
: this(globalSettings.Value)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Umbraco.Web.Common.AspNetCore
|
||||
|
||||
private string _localTempPath;
|
||||
|
||||
public AspNetCoreHostingEnvironment(IOptionsSnapshot<HostingSettings> hostingSettings, IWebHostEnvironment webHostEnvironment)
|
||||
public AspNetCoreHostingEnvironment(IOptions<HostingSettings> hostingSettings, IWebHostEnvironment webHostEnvironment)
|
||||
: this(hostingSettings.Value, webHostEnvironment)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Umbraco.Web.Common.AspNetCore
|
||||
public AspNetCoreRequestAccessor(IHttpContextAccessor httpContextAccessor,
|
||||
IUmbracoRequestLifetime umbracoRequestLifetime,
|
||||
IUmbracoContextAccessor umbracoContextAccessor,
|
||||
IOptionsSnapshot<WebRoutingSettings> webRoutingSettings)
|
||||
IOptions<WebRoutingSettings> webRoutingSettings)
|
||||
{
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
_umbracoContextAccessor = umbracoContextAccessor;
|
||||
|
||||
@@ -25,8 +25,8 @@ namespace Umbraco.Web.Common.AspNetCore
|
||||
|
||||
private IUmbracoContext _umbracoContext;
|
||||
private IUmbracoContextAccessor UmbracoContextAccessor => Context.RequestServices.GetRequiredService<IUmbracoContextAccessor>();
|
||||
private GlobalSettings GlobalSettings => Context.RequestServices.GetRequiredService<IOptionsSnapshot<GlobalSettings>>().Value;
|
||||
private ContentSettings ContentSettings => Context.RequestServices.GetRequiredService<IOptionsSnapshot<ContentSettings>>().Value;
|
||||
private GlobalSettings GlobalSettings => Context.RequestServices.GetRequiredService<IOptions<GlobalSettings>>().Value;
|
||||
private ContentSettings ContentSettings => Context.RequestServices.GetRequiredService<IOptions<ContentSettings>>().Value;
|
||||
private IProfilerHtml ProfilerHtml => Context.RequestServices.GetRequiredService<IProfilerHtml>();
|
||||
private IIOHelper IOHelper => Context.RequestServices.GetRequiredService<IIOHelper>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user