Example #1
0
        public QuestionPropositionTO Update(QuestionPropositionTO Entity)
        {
            if (Entity is null)
            {
                throw new Exception();
            }

            return(evaluationContext.QuestionPropositions.Update(Entity.ToEF()).Entity.ToTransfertObject());
        }
Example #2
0
        public QuestionPropositionTO Add(QuestionPropositionTO Entity)
        {
            if (Entity is null)
            {
                throw new ArgumentNullException(nameof(Entity));
            }

            var questionproposition = Entity.ToEF();

            questionproposition.Question = evaluationContext.Questions.FirstOrDefault(q => q.Id == Entity.QuestionId);

            return(evaluationContext.QuestionPropositions.Add(questionproposition).Entity.ToTransfertObject());
        }