public async Task <IActionResult> Create([Bind("Id,Title,Content,CreatedAt,Published")] Post post) { if (ModelState.IsValid) { _context.Add(post); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(post)); }
public async Task <IActionResult> Create([Bind("Id,CategoryName")] Category category) { if (ModelState.IsValid) { _context.Add(category); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(category)); }