Fix Unit & Integration tests

This commit is contained in:
Nikolaj Geisle
2022-02-11 14:27:04 +01:00
parent 83baba696c
commit 58f6226942
8 changed files with 22 additions and 21 deletions

View File

@@ -149,17 +149,17 @@ namespace Umbraco.Extensions
{
builder.Services
};
// Replace the default with our custom engine
builder.Services.AddSingleton<IRazorViewEngine>(
s => new RefreshingRazorViewEngine(
() =>
{
// re-create the original container so that a brand new IRazorPageActivator
// is produced, if we don't re-create the container then it will just return the same instance.
ServiceProvider recreatedServices = initialCollection.BuildServiceProvider();
return recreatedServices.GetRequiredService<IRazorViewEngine>();
}, s.GetRequiredService<InMemoryModelFactory>()));
//
// // Replace the default with our custom engine
// builder.Services.AddSingleton<IRazorViewEngine>(
// s => new RefreshingRazorViewEngine(
// () =>
// {
// // re-create the original container so that a brand new IRazorPageActivator
// // is produced, if we don't re-create the container then it will just return the same instance.
// ServiceProvider recreatedServices = initialCollection.BuildServiceProvider();
// return recreatedServices.GetRequiredService<IRazorViewEngine>();
// }, s.GetRequiredService<InMemoryModelFactory>()));
return builder;
}