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)); }
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)); }