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