public async Task <IActionResult> Create([Bind("Id,Title,Content,ImageURL,Author,PublishDate,IsDraft")] News news) { if (ModelState.IsValid) { _context.Add(news); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(news)); }
public async Task <IActionResult> Create([Bind("Id,Title,Author,Content,Price,PriceEBook,PriceAudiobook,IdCategory,ImageURL,Rating,IsFeatured")] Product product) { if (ModelState.IsValid) { _context.Add(product); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(product)); }
public async Task <IActionResult> Create([Bind("Id,CreatedAt,Login,FirstName,LastName,Address,Sum")] Order order) { if (ModelState.IsValid) { _context.Add(order); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(order)); }
public async Task <IActionResult> Create([Bind("Id,Title,Content,IdParentCategory")] Category category) { if (ModelState.IsValid) { _context.Add(category); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(category)); }