|
@@ -3,12 +3,15 @@ using Microsoft.AspNetCore.Hosting;
|
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.Configuration;
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
using Microsoft.Extensions.Hosting;
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
|
+using Ninject.Web.AspNetCore;
|
|
|
|
|
+using Ninject.Web.AspNetCore.Hosting;
|
|
|
|
|
|
|
|
namespace CronAlarm
|
|
namespace CronAlarm
|
|
|
{
|
|
{
|
|
|
- public class Startup
|
|
|
|
|
|
|
+ public class Startup : AspNetCoreStartupBase
|
|
|
{
|
|
{
|
|
|
- public Startup(IConfiguration configuration)
|
|
|
|
|
|
|
+ public Startup(IConfiguration configuration, IServiceProviderFactory<NinjectServiceProviderBuilder> providerFactory)
|
|
|
|
|
+ : base(providerFactory)
|
|
|
{
|
|
{
|
|
|
Configuration = configuration;
|
|
Configuration = configuration;
|
|
|
}
|
|
}
|
|
@@ -17,15 +20,18 @@ namespace CronAlarm
|
|
|
|
|
|
|
|
// This method gets called by the runtime. Use this method to add services to the container.
|
|
// This method gets called by the runtime. Use this method to add services to the container.
|
|
|
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
|
|
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
|
|
|
- public void ConfigureServices(IServiceCollection services)
|
|
|
|
|
|
|
+ public override void ConfigureServices(IServiceCollection services)
|
|
|
{
|
|
{
|
|
|
services.AddRazorPages();
|
|
services.AddRazorPages();
|
|
|
services.AddServerSideBlazor();
|
|
services.AddServerSideBlazor();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
|
|
|
|
- public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
|
|
|
|
|
|
+ public override void Configure(IApplicationBuilder app)
|
|
|
{
|
|
{
|
|
|
|
|
+ // For simplicitly, there is only one overload of Configure supported, so in order to get the additional
|
|
|
|
|
+ // services, you can just resolve them with the service provider.
|
|
|
|
|
+ var env = app.ApplicationServices.GetRequiredService<IWebHostEnvironment>();
|
|
|
|
|
+
|
|
|
if (env.IsDevelopment())
|
|
if (env.IsDevelopment())
|
|
|
{
|
|
{
|
|
|
app.UseDeveloperExceptionPage();
|
|
app.UseDeveloperExceptionPage();
|