|
@@ -10,7 +10,8 @@ using MTWorkHR.Core.Global;
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
|
|
// Add services to the container.
|
|
|
-builder.Services.AddDbContext<HRDataContext>(options => {
|
|
|
+builder.Services.AddDbContext<HRDataContext>(options =>
|
|
|
+{
|
|
|
options.UseSqlServer(builder.Configuration.GetSection("ConnectionStrings:MTWorkHRConnectionString").Value);
|
|
|
});
|
|
|
var config = new AppSettingsConfiguration();
|
|
@@ -28,11 +29,11 @@ builder.Services.AddSwaggerGen();
|
|
|
var app = builder.Build();
|
|
|
|
|
|
// Configure the HTTP request pipeline.
|
|
|
-if (app.Environment.IsDevelopment())
|
|
|
-{
|
|
|
- app.UseSwagger();
|
|
|
- app.UseSwaggerUI();
|
|
|
-}
|
|
|
+// if (app.Environment.IsDevelopment())
|
|
|
+// {
|
|
|
+app.UseSwagger();
|
|
|
+app.UseSwaggerUI();
|
|
|
+// }
|
|
|
|
|
|
app.UseHttpsRedirection();
|
|
|
app.UseAuthentication();
|