From b7ba8c499ca7afb93482a90b85f5b016aa8b1121 Mon Sep 17 00:00:00 2001 From: Vijay Uppu <913468@dadeschools.net> Date: Wed, 15 Nov 2023 12:35:45 -0500 Subject: [PATCH] fixed question translation issue --- .../DamageAssesment.Api.Questions/Providers/QuestionsProvider.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/DamageAssesmentApi/DamageAssesment.Api.Questions/Providers/QuestionsProvider.cs b/DamageAssesmentApi/DamageAssesment.Api.Questions/Providers/QuestionsProvider.cs index 995b6f1..0ce443d 100644 --- a/DamageAssesmentApi/DamageAssesment.Api.Questions/Providers/QuestionsProvider.cs +++ b/DamageAssesmentApi/DamageAssesment.Api.Questions/Providers/QuestionsProvider.cs @@ -349,6 +349,7 @@ namespace DamageAssesment.Api.Questions.Providers var dbquestiontranslation = mapper.Map, List>(Question.Questions); dbquestion.QuestionTypeId = questionDbContext.QuestionTypes.Where(a => a.TypeText == Question.TypeText).Select(a => a.Id).FirstOrDefault(); questionDbContext.Questions.Add(dbquestion); + questionDbContext.SaveChanges(); dbquestiontranslation.ForEach(i => i.QuestionId = dbquestion.Id); questionDbContext.QuestionsTranslations.AddRange(dbquestiontranslation); questionDbContext.SaveChanges();