Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("Id,Content,SecretCode")] Question question)
        {
            if (ModelState.IsValid)
            {
                _context.Add(question);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(question));
        }
        public async Task <IActionResult> Create([Bind("Id,Content")] Answer answer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(answer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(answer));
        }
Esempio n. 3
0
 public virtual T Add(T entity)
 {
     return(context.Add(entity).Entity);
 }