public void AddMultiChoiceAnswers(MultichoiceAnswer multiChoiseAnswer)
 {
     using (var context = new FinalProjectDBEntities1())
     {
         context.MultichoiceAnswers.Add(multiChoiseAnswer);
     }
 }
 public void DeleteAddMultiChoiceAnswers(int Id)
 {
     using (var context = new FinalProjectDBEntities1())
     {
         MultichoiceAnswer multiChoiceAnswer = context.MultichoiceAnswers.Find(Id);
         context.MultichoiceAnswers.Remove(multiChoiceAnswer);
     }
 }
        public static MultichoiceAnswerDto ToMultichoiceAnswerDto(this MultichoiceAnswer multichoice)
        {
            if (multichoice == null)
            {
                return(null);
            }

            var multichoiceDto = new MultichoiceAnswerDto
            {
                Id         = multichoice.Id,
                AnswerText = multichoice.AnswerText,
                IsCorrect  = multichoice.IsCorrect.Value,
            };

            return(multichoiceDto);
        }