瀏覽代碼

解决nlog定时创表问题

Murphy 3 年之前
父節點
當前提交
95c68bf7f7
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      MicroServices/Business/Business.Host/Startup.cs

+ 2 - 0
MicroServices/Business/Business.Host/Startup.cs

@@ -1,5 +1,6 @@
 using Business.Core.MongoDBHelper;
 using Business.Core.MongoDBHelper;
 using Business.EntityFrameworkCore.SqlRepositories;
 using Business.EntityFrameworkCore.SqlRepositories;
+using Business.Quartz;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.DependencyInjection;
@@ -16,6 +17,7 @@ namespace Business
             services.AddScoped(typeof(IMongoDB<>), typeof(MongoDBTools<>));
             services.AddScoped(typeof(IMongoDB<>), typeof(MongoDBTools<>));
             services.AddScoped(typeof(ISqlRepository<>), typeof(SqlRepository<>));
             services.AddScoped(typeof(ISqlRepository<>), typeof(SqlRepository<>));
             services.AddScoped<Config>();
             services.AddScoped<Config>();
+            services.AddScoped<LogHostedService>();
         }
         }
 
 
         public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
         public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)