fixed multiple question saving issue
This commit is contained in:
parent
b227d32f89
commit
1f3c0f0524
@ -350,6 +350,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();
|
||||
|
Loading…
Reference in New Issue
Block a user