public async Task <IActionResult> Edit(int id, [Bind("ToyStoreId,StoreNAme,City,Phone,OpeningTime,ClosingTime")] ToyStore toyStore) { if (id != toyStore.ToyStoreId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(toyStore); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ToyStoreExists(toyStore.ToyStoreId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(toyStore)); }
public async Task <IActionResult> Create([Bind("ToyStoreId,StoreNAme,City,Phone,OpeningTime,ClosingTime")] ToyStore toyStore) { if (ModelState.IsValid) { _context.Add(toyStore); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(toyStore)); }