public ActionResult UpdateAnswer([FromBody] AnswerUpdate req)
        {
            IdeationAnswers answer = _context.IdeationAnswers.First(a => a.Uid == req.Uid);

            answer.Answer = req.Answer;

            _context.SaveChanges();

            return(Ok(new { message = "Success!" }));
        }
        public ActionResult CreateConcept([FromBody] ConceptRequest req)
        {
            var     new_uid  = Guid.NewGuid().ToString();
            Project proj     = _context.Project.Where(p => p.Uid == req.projectUid).FirstOrDefault();
            var     answerls = req.answerList;
            var     length   = _context.Question.Count <Question>();

            Concept cpt = new Concept
            {
                Uid             = new_uid,
                ProjectId       = proj.Id,
                ConceptName     = req.ConceptName,
                NewsHeadline    = req.NewsHeadline,
                Customer        = req.Customer,
                CustomerProblem = req.CustomerProblem,
                Promise         = req.Promise,
                Proof           = req.Proof,
                Price           = req.Price,
                Passion         = req.Passion,
                DeathThreats    = req.DeathThreats
            };

            _context.Concept.Add(cpt);
            _context.SaveChanges();

            var conc = _context.Concept.Where(c => c.Uid == new_uid).FirstOrDefault <Concept>();

            for (int i = 0; i < answerls.Length; i++)
            {
                if (answerls[i] != null)
                {
                    IdeationAnswers ans = new IdeationAnswers
                    {
                        Uid    = Guid.NewGuid().ToString(),
                        Cid    = conc.Id,
                        Qid    = i,
                        Answer = answerls[i]
                    };

                    _context.IdeationAnswers.Add(ans);
                }
            }

            _context.SaveChanges();

            return(Ok(new { message = "Success!" }));
        }
        public ActionResult PostAnswer([FromBody] AnswerSubmission req)
        {
            var     answerls = req.AnswerList;
            Concept cpt      = _context.Concept.Where(c => c.Uid == req.Cuid).FirstOrDefault <Concept>();

            foreach (var obj in answerls)
            {
                if (obj != null)
                {
                    IdeationAnswers ans = new IdeationAnswers
                    {
                        Uid    = Guid.NewGuid().ToString(),
                        Cid    = cpt.Id,
                        Qid    = Array.IndexOf(answerls, obj),
                        Answer = obj
                    };

                    _context.IdeationAnswers.Add(ans);
                }
            }
            _context.SaveChanges();

            return(Ok(new { message = "Success!" }));
        }