public async Task <IActionResult> SetMainImage(HomePageSportComplexViewModel model)
        {
            int counter = 0;

            if (model.ImageList.IsNullOrEmpty())
            {
                this.ModelState.AddModelError(string.Empty, "There are no images for this complex.");
                return(this.Redirect("/"));
            }

            foreach (var image in model.ImageList)
            {
                if (image.IsMainImage == true)
                {
                    counter++;
                }
            }

            if (counter > 1)
            {
                this.ModelState.AddModelError(string.Empty, "Select only one picture.");
                return(this.View(model));
            }

            await this.imageService.SetMainImage(model.Id, model.ImageList);

            return(this.Redirect("/"));
        }
        public async Task <IActionResult> DeleteImages(HomePageSportComplexViewModel input)
        {
            await this.imageService.DeleteImages(input.Id, input.ImageList);

            return(this.RedirectToAction("SetMainImage", new { id = input.Id }));
        }