NamespaceSystemLibrary.Common.Web.Extensions
Extension methods for IServiceCollection
IServiceCollectionExtensions
public static class IServiceCollectionExtensions
Inheritance
System.Object
IServiceCollectionExtensions
Extension methods for IServiceCollection
Configures ServiceCollection in one-line, so register all of your own or other service configurations after this one
Registers:
Optionally, through the argument ServicesCollectionOptions:
Startup.cs/Program.cs:
public void ConfigureServices(IServiceCollection services)
{
var options = new ServicesCollectionOptions();
options.ViewLocations = new string[] {
"~/Views/{0}/index.cshtml"
}
options.AreaViewLocations = new string[] {
"~/Area/{2}/{1}/{0}.cshtml"
}
options.ViewLocationExpander = null; //or create one based on the Interface 'IViewLocationExpander'
services.AddCommonWebServices(options);
}
Type | Name | Description |
---|---|---|
Microsoft.Extensions.DependencyInjection.IServiceCollection | services | |
ServicesCollectionOptions | options |
Type | Description |
---|---|
Microsoft.Extensions.DependencyInjection.IServiceCollection |
Type | Name | Description |
---|---|---|
Microsoft.Extensions.DependencyInjection.IServiceCollection | services | |
ServicesCollectionOptions | options |
Type | Description |
---|---|
Microsoft.Extensions.DependencyInjection.IServiceCollection |
}