Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/linux-paths

# Conflicts:
#	src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/TempFileCleanupTests.cs
#	src/Umbraco.Web.Common/Extensions/UmbracoCoreServiceCollectionExtensions.cs
This commit is contained in:
Bjarke Berg
2020-11-26 13:14:26 +01:00
212 changed files with 3095 additions and 3121 deletions

View File

@@ -0,0 +1,33 @@
using System;
using Microsoft.Extensions.Options;
namespace Umbraco.Web.Common.AspNetCore
{
/// <summary>
/// HACK: OptionsMonitor but without the monitoring, hopefully temporary.
/// This is just used so we can get an AspNetCoreHostingEnvironment to
/// build a TypeLoader long before ServiceProvider is built.
/// </summary>
[Obsolete("Please let the container wire up a real OptionsMonitor for you")]
internal class OptionsMonitorAdapter<T> : IOptionsMonitor<T> where T : class, new()
{
private readonly T _inner;
public OptionsMonitorAdapter(T inner)
{
_inner = inner ?? throw new ArgumentNullException(nameof(inner));
}
public T Get(string name)
{
return _inner;
}
public IDisposable OnChange(Action<T, string> listener)
{
throw new NotImplementedException();
}
public T CurrentValue => _inner;
}
}