Пример #1
0
        public async Task <IActionResult> Create([Bind("ID,WordText,Translation,Description")] Word word)
        {
            if (ModelState.IsValid)
            {
                _context.Add(word);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(word));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("ID,ExampleText,ExampleTranslation,WordID")] Example example)
        {
            if (ModelState.IsValid)
            {
                _context.Add(example);
                await _context.SaveChangesAsync();

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