Merge with dev branch

This commit is contained in:
Santhosh S
2023-09-05 00:15:17 -04:00
29 changed files with 362 additions and 415 deletions

View File

@ -7,6 +7,7 @@
Task<(bool IsSuccess, Models.Survey Survey, string ErrorMessage)> PostSurveyAsync(Models.Survey Survey);
Task<(bool IsSuccess, Models.Survey Survey, string ErrorMessage)> PutSurveyAsync(int Id,Models.Survey Survey);
Task<(bool IsSuccess, Models.Survey Survey, string ErrorMessage)> DeleteSurveyAsync(int Id);
void seedData();
}
}

View File

@ -55,10 +55,18 @@ if (app.Environment.IsDevelopment())
app.UseSwagger();
app.UseSwaggerUI(options => {
//switch for local environment
options.SwaggerEndpoint("/swagger/v1/swagger.json", "");
//options.SwaggerEndpoint("/surveys/swagger/v1/swagger.json", "");
// options.SwaggerEndpoint("/swagger/v1/swagger.json", "");
options.SwaggerEndpoint("/surveys/swagger/v1/swagger.json", "");
});
app.UseSwaggerUI();
using (var serviceScope = app.Services.CreateScope())
{
var services = serviceScope.ServiceProvider;
var surveyProvider = services.GetRequiredService<ISurveyProvider>();
surveyProvider.seedData();
}
}
app.UseAuthentication();

View File

@ -18,10 +18,10 @@ namespace DamageAssesment.Api.Surveys.Providers
this.surveyDbContext = surveysDbContext;
this.logger = logger;
this.mapper = mapper;
seedData();
//seedData();
}
private void seedData()
public void seedData()
{
if (!surveyDbContext.Surveys.Any())
{