Пример #1
0
        public async Task <IActionResult> Create([Bind("Id,DateAdded,Question,Answer")] QnAPair qnAPair)
        {
            if (ModelState.IsValid)
            {
                _context.Add(qnAPair);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(qnAPair));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("Id,ServiceId,BaseAddress,Key,DisplayName,DisplayCategory")] QnAMakerService qnAMakerService)
        {
            if (ModelState.IsValid)
            {
                _context.Add(qnAMakerService);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(qnAMakerService));
        }