public async Task <int> CreateQuestionCard(CreateQuestionCardModel model) { QuestionCard newCard = MapToEntity(model); context.QuestionCards.Add(newCard); await context.SaveChangesAsync(); return(newCard.QuestionCardId); }
private QuestionCard MapToEntity(CreateQuestionCardModel model) { return(new QuestionCard { LanguageId = model.LanguageId, Text = model.Text, IsAdultContent = model.IsAdultContent, NumberOfAnswers = model.NumberOfAnswers, CreateDate = DateTime.UtcNow, IsActive = true }); }