public void SortOrders(int[] carsouselIds) { for (int i = 0; i < carsouselIds.Length; i++) { var carousel = _carouselBLL.GetByid(carsouselIds [i]); carousel.Order = i; _carouselBLL.Save(carousel); } }
public IActionResult Save(CarouselEditViewModel carouselVM) { var carousel = carouselVM.ToModel(); if (carouselVM.Image != null) { carousel.ImageUrl = UploadImage(carouselVM.Image); } _carouselBLL.Save(carousel); SetMessage($"Carousel Id {carousel.Id} Saved Succesfuly"); return(RedirectToAction("List")); }