Most IServiceCollection extension methods return the IServiceCollection instance passed in. This change updates the AddRazorLight method to be consistent, so that something like this is possible:
var serviceProvider = new ServiceCollection()
.AddRazorLight(() =>
new RazorLightEngineBuilder()
.UseEmbeddedResourcesProject(typeof(Program))
.UseMemoryCachingProvider()
.Build())
.AddSingleton(new MyService())
.BuildServiceProvider();
Most
IServiceCollection
extension methods return theIServiceCollection
instance passed in. This change updates theAddRazorLight
method to be consistent, so that something like this is possible: