public async Task <IActionResult> Edit(int id, [Bind("Id,Image,Description,Name,Title,IsDeleted,TimeDeleted")] AboutCarousel aboutCarousel) { if (id != aboutCarousel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(aboutCarousel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AboutCarouselExists(aboutCarousel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(aboutCarousel)); }
public async Task <IActionResult> Create([Bind("Id,Image,Description,Name,Title,IsDeleted,TimeDeleted")] AboutCarousel aboutCarousel) { if (ModelState.IsValid) { _context.Add(aboutCarousel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(aboutCarousel)); }