Class ServiceCollectionExtensions
- Namespace
- Umbraco.Extensions
- Assembly
- Umbraco.Web.Common.dll
public static class ServiceCollectionExtensions
- Inheritance
-
ServiceCollectionExtensions
- Inherited Members
Methods
AddLogger(IServiceCollection, IHostEnvironment, IConfiguration)
Create and configure the logger.
public static IServiceCollection AddLogger(this IServiceCollection services, IHostEnvironment hostEnvironment, IConfiguration configuration)
Parameters
services
IServiceCollectionhostEnvironment
IHostEnvironmentconfiguration
IConfiguration
Returns
Remarks
Additional Serilog services are registered during ConfigureUmbracoDefaults(IHostBuilder).
AddLogger(IServiceCollection, IHostingEnvironment, ILoggingConfiguration, IConfiguration)
Create and configure the logger
[Obsolete("Use the extension method that takes an IHostEnvironment instance instead.")]
public static IServiceCollection AddLogger(this IServiceCollection services, IHostingEnvironment hostingEnvironment, ILoggingConfiguration loggingConfiguration, IConfiguration configuration)
Parameters
services
IServiceCollectionhostingEnvironment
IHostingEnvironmentloggingConfiguration
ILoggingConfigurationconfiguration
IConfiguration
Returns
AddTypeLoader(IServiceCollection, Assembly?, ILoggerFactory, IConfiguration)
Called to create the Umbraco.Cms.Core.Composing.TypeLoader to assign to the Umbraco.Cms.Core.DependencyInjection.IUmbracoBuilder
public static TypeLoader AddTypeLoader(this IServiceCollection services, Assembly? entryAssembly, ILoggerFactory loggerFactory, IConfiguration configuration)
Parameters
services
IServiceCollectionentryAssembly
AssemblyloggerFactory
ILoggerFactoryconfiguration
IConfiguration
Returns
- TypeLoader
Remarks
This should never be called in a web project. It is used internally by Umbraco but could be used in unit tests. If called in a web project it will have no affect except to create and return a new TypeLoader but this will not be the instance in DI.
AddTypeLoader(IServiceCollection, Assembly, IHostingEnvironment, ILoggerFactory, AppCaches, IConfiguration, IProfiler)
Called to create the Umbraco.Cms.Core.Composing.TypeLoader to assign to the Umbraco.Cms.Core.DependencyInjection.IUmbracoBuilder
[Obsolete("Please use alternative extension method.")]
public static TypeLoader AddTypeLoader(this IServiceCollection services, Assembly entryAssembly, IHostingEnvironment hostingEnvironment, ILoggerFactory loggerFactory, AppCaches appCaches, IConfiguration configuration, IProfiler profiler)
Parameters
services
IServiceCollectionentryAssembly
AssemblyhostingEnvironment
IHostingEnvironmentloggerFactory
ILoggerFactoryappCaches
AppCachesconfiguration
IConfigurationprofiler
IProfiler
Returns
- TypeLoader
Remarks
This should never be called in a web project. It is used internally by Umbraco but could be used in unit tests. If called in a web project it will have no affect except to create and return a new TypeLoader but this will not be the instance in DI.