Info
Version: | 1.0.2.6 |
Author(s): | Jack.Extensions.DependencyInjection |
Last Update: | Thursday, July 2, 2020 |
.NET Fiddle: | Create the first Fiddle |
Project Url: | https://github.com/simpleway2016/Jack.Extensions.DependencyInjection.git |
NuGet Url: | https://www.nuget.org/packages/Jack.Extensions.DependencyInjection |
Install
Install-Package Jack.Extensions.DependencyInjection
dotnet add package Jack.Extensions.DependencyInjection
paket add Jack.Extensions.DependencyInjection
Jack.Extensions.DependencyInjection Download (Unzip the "nupkg" after downloading)
Dependencies
- Microsoft.AspNetCore.Mvc.Core(>= 2.1.0)
- Microsoft.Extensions.DependencyInjection(>= 2.1.0)
.net core 2.x Startup中:
public IServiceProvider ConfigureServices(IServiceCollection services)
{
//your codes here ...
return services.BuildJackServiceProvider();
}
.net core 3.x Program中:
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.UseServiceProviderFactory(new JackAspNetCoreServiceProviderFactory())
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}.