public async Task <IActionResult> Create([Bind("VideoID,VideoName,VideoNum,VideoURL")] Video video) { if (ModelState.IsValid) { _context.Add(video); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(video)); }
public async Task <IActionResult> Create([Bind("ID,Name,Author,Publisher,ISBN,Details,Rank,Price,ImageUrl")] Book book) { if (ModelState.IsValid) { _context.Add(book); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(book)); }
public async Task <IActionResult> Create([Bind("PostId,Title,Content,Time")] Post post) { if (ModelState.IsValid) { _context.Add(post); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(post)); }
public async Task <IActionResult> Create([Bind("BlogId,BlogUrl,BlogAuthor")] Blog blog) { if (ModelState.IsValid) { _context.Add(blog); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(blog)); }