public async Task <IActionResult> Edit(long id, [Bind("SnowboardsId,Products,Model,Lenght,Price,Quantity,CratedDate")] Snowboards snowboards) { if (id != snowboards.SnowboardsId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(snowboards); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SnowboardsExists(snowboards.SnowboardsId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(snowboards)); }
public async Task <IActionResult> Create([Bind("SnowboardsId,Products,Model,Lenght,Price,Quantity,CratedDate")] Snowboards snowboards) { if (ModelState.IsValid) { _context.Add(snowboards); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(snowboards)); }