fixed question translation issue

This commit is contained in:
Vijay Uppu 2023-11-15 12:35:17 -05:00
parent f8cb7e7980
commit 0c7fe88d45

View File

@ -349,6 +349,7 @@ namespace DamageAssesment.Api.Questions.Providers
var dbquestiontranslation = mapper.Map<List<Models.QuestionsTranslation>, List<Db.QuestionsTranslation>>(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();