public QuestionVM UpdateQuestion(QuestionVM form) { Question question = form.ToPoco(); _context.Questions.Attach(question); _context.Entry(question).State = EntityState.Modified; _context.SaveChanges(); return(new QuestionVM(question)); }
public QuestionVM CreateQuestion(QuestionVM question) { _context.Questions.Add(question.ToPoco()); _context.SaveChanges(); return(question); }