forked from MDCPS/DamageAssessment_Backend
		
	Fix for Data seed issue,Url Correction for SurveyResponses
This commit is contained in:
		| @ -4,5 +4,6 @@ | ||||
|     { | ||||
|         Task<(bool IsSuccess, Db.QuestionType QuestionType, string ErrorMessage)> GetQuestionTypeAsync(int Id); | ||||
|         Task<(bool IsSuccess, IEnumerable<Db.QuestionType> QuestionTypes, string ErrorMessage)> GetQuestionTypesAsync(); | ||||
|         | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -17,5 +17,6 @@ namespace DamageAssesment.Api.Questions.Interfaces | ||||
|         Task<(bool IsSuccess, Models.QuestionCategory QuestionCategory, string ErrorMessage)> PostQuestionCategoryAsync(Models.QuestionCategory QuestionCategory); | ||||
|         Task<(bool IsSuccess, Models.QuestionCategory QuestionCategory, string ErrorMessage)> UpdateQuestionCategoryAsync(Models.QuestionCategory QuestionCategory); | ||||
|         Task<(bool IsSuccess, Models.QuestionCategory QuestionCategory, string ErrorMessage)> DeleteQuestionCategoryAsync(int Id); | ||||
|         void SeedData(); | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -35,8 +35,20 @@ var app = builder.Build(); | ||||
| // Configure the HTTP request pipeline. | ||||
| if (app.Environment.IsDevelopment()) | ||||
| { | ||||
|     using (var serviceScope = app.Services.CreateScope()) | ||||
|     { | ||||
|         var services = serviceScope.ServiceProvider; | ||||
|         var questionProvider = services.GetRequiredService<IQuestionsProvider>(); | ||||
|         questionProvider.SeedData(); | ||||
|     } | ||||
|  | ||||
|     app.UseSwagger(); | ||||
|     app.UseSwaggerUI(options => { options.SwaggerEndpoint("/questions/swagger/v1/swagger.json", ""); }); | ||||
|     app.UseSwaggerUI(options => { | ||||
|         //switch for local environment | ||||
|         options.SwaggerEndpoint("/swagger/v1/swagger.json", ""); | ||||
|      //   options.SwaggerEndpoint("/questions/swagger/v1/swagger.json", ""); | ||||
|      | ||||
|     }); | ||||
| } | ||||
|  | ||||
| app.UseAuthorization(); | ||||
|  | ||||
| @ -21,10 +21,10 @@ namespace DamageAssesment.Api.Questions.Providers | ||||
|             this.questionDbContext = questionDbContext; | ||||
|             this.logger = logger; | ||||
|             this.mapper = mapper; | ||||
|             SeedData(); | ||||
|            // SeedData(); | ||||
|         } | ||||
|  | ||||
|         private void SeedData() | ||||
|         public void SeedData() | ||||
|         { | ||||
|  | ||||
|             if (!questionDbContext.QuestionsTranslations.Any()) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user