Пример #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            Answer answer = await db.Answers.FindAsync(id);

            db.Answers.Remove(answer);
            await db.SaveChangesAsync();

            return(RedirectToActionPermanent("Index"));
        }
        public async Task <ActionResult <Answers> > PostAnswers(Answers answers)
        {
            _context.Answers.Add(answers);
            await _context.SaveChangesAsync();

            Bundle            bundle    = GetBundle.ReturnBundle(answers);
            RecommendedBundle recBundle = new RecommendedBundle(answers.Id, answers.Age, answers.Student, answers.Income, bundle.Name);

            List <RecommendedBundle> outputBundles = new List <RecommendedBundle>();

            return(CreatedAtAction("GetAnswers", new { id = answers.Id }, bundle));
        }