Startup.cs 1.0 KB

123456789101112131415161718192021222324252627282930
  1. using Business.Core.MongoDBHelper;
  2. using Business.EntityFrameworkCore.SqlRepositories;
  3. using Business.Quartz;
  4. using GZY.Quartz.MUI.Extensions;
  5. using Microsoft.AspNetCore.Builder;
  6. using Microsoft.AspNetCore.Hosting;
  7. using Microsoft.Extensions.DependencyInjection;
  8. using Microsoft.Extensions.Logging;
  9. namespace Business
  10. {
  11. public class Startup
  12. {
  13. public void ConfigureServices(IServiceCollection services)
  14. {
  15. services.AddApplication<BusinessHostModule>();
  16. //MongoDBHelperÒÀÀµ×¢Èë
  17. services.AddScoped(typeof(IMongoDB<>), typeof(MongoDBTools<>));
  18. services.AddScoped(typeof(ISqlRepository<>), typeof(SqlRepository<>));
  19. services.AddScoped<Config>();
  20. services.AddScoped<LogHostedService>();
  21. services.AddScoped<GZY.Quartz.MUI.Areas.MyFeature.Pages.MainModel>();
  22. }
  23. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
  24. {
  25. app.InitializeApplication();
  26. }
  27. }
  28. }