Ich aktualisiere derzeit ein Projekt von .NET Core RC1 auf die neue RTM 1.0-Version. In RC1 gab es ein IApplicationEnvironment
, die mit IHostingEnvironment
in der Version 1.0Setzen Sie die IHostingEnvironment in Komponententest
In RC1 ersetzt wurde ich dies tun könnte
public class MyClass
{
protected static IApplicationEnvironment ApplicationEnvironment { get;private set; }
public MyClass()
{
ApplicationEnvironment = PlatformServices.Default.Application;
}
}
Wer weiß, wie dies in v1.0 zu erreichen?
public class MyClass
{
protected static IHostingEnvironment HostingEnvironment { get;private set; }
public MyClass()
{
HostingEnvironment = ???????????;
}
}
Man konnte es nur in der Unit-Test verspotten die Schnittstelle durch die Umsetzung . –