public void Delete(int id)
        {
            IdeationQuestionsDao dao = _ctx.IdeationQuestions.First(d => d.IquestionId == id);

            _ctx.IdeationQuestions.Remove(dao);
            _ctx.SaveChanges();
        }
        public IdeationQuestion Read(int id, bool details)
        {
            IdeationQuestionsDao ideationQuestionDao = details ? _ctx.IdeationQuestions.AsNoTracking().First(i => i.IquestionId == id) : _ctx.IdeationQuestions.First(i => i.IquestionId == id);

            ExtensionMethods.CheckForNotFound(ideationQuestionDao, "IdeationQuestion", id);

            return(ConvertToDomain(ideationQuestionDao));
        }
 private IdeationQuestion ConvertToDomain(IdeationQuestionsDao dao)
 {
     return(new IdeationQuestion
     {
         Id = dao.IquestionId,
         Description = dao.Description,
         SiteUrl = dao.WebsiteLink,
         QuestionTitle = dao.QuestionTitle,
         Ideation = new Ideation {
             Id = dao.ModuleId
         }
     });
 }
        public void Update(IdeationQuestion obj)
        {
            IdeationQuestionsDao newIdeationQuestion   = ConvertToDao(obj);
            IdeationQuestionsDao foundIdeationQuestion = _ctx.IdeationQuestions.First(i => i.IquestionId == obj.Id);

            if (foundIdeationQuestion != null)
            {
                foundIdeationQuestion.QuestionTitle = newIdeationQuestion.QuestionTitle;
                foundIdeationQuestion.Description   = newIdeationQuestion.Description;
                foundIdeationQuestion.WebsiteLink   = newIdeationQuestion.WebsiteLink;
            }

            _ctx.SaveChanges();
        }