Beispiel #1
0
        public async Task <IActionResult> Create([Bind("id,uczelnia,wydzial,autor,tytul,kategoria,opis")] Announcement announcement)
        {
            if (ModelState.IsValid)
            {
                _context.Add(announcement);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(announcement));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("Id,Title,Body,DatePosted,Author")] Announcement announcement)
        {
            if (ModelState.IsValid)
            {
                _context.Add(announcement);
                await _context.SaveChangesAsync();

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