public void DeleteQuestion(QuestionDto question) { _dbConnection.Execute("DELETE FROM Questions WHERE Id = @id", new { id = question.Id }); }
public void AddQuestionToCourse(QuestionDto question, CourseDto course) { _dbConnection.Execute( "INSERT INTO Questions(Id, CourseId, Text, Difficulty, WrongAnswer1, WrongAnswer2, WrongAnswer3, RightAnswer) VALUES(@id, @courseId, @text, @difficulty, @wrongAnswer1, @wrongAnswer2, @wrongAnswer3, @rightAnswer)", new { id = question.Id, courseId = course.Id, text = question.Text, difficulty = question.Difficulty, wrongAnswer1 = question.WrongAnswer1, wrongAnswer2 = question.WrongAnswer2, wrongAnswer3 = question.WrongAnswer3, rightAnswer = question.RightAnswer }); }