public async Task <IActionResult> Create([Bind("CategoryID,Name")] Category category) { if (ModelState.IsValid) { _context.Add(category); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(category)); }
public async Task <IActionResult> Create([Bind("OfferID,Title,Description,NewPrice,OldPrice,DeliveryPrice,EndDate,Link,DiscountCode,Image,IsAvaliable")] Offer offer) { if (ModelState.IsValid) { _context.Add(offer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(offer)); }