public async Task <IActionResult> Edit(ResortFormServiceModel model, int id)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            if (!await this.resortService.ResortExistsAsync(id))
            {
                TempData.AddErrorMessage($"Resort with id {id} does not exist");
                return(RedirectToHome());
            }

            if (!User.IsInRole(WebConstants.AdministratorRole))
            {
                if (!await resortService.IsResortOfUserAsync(id, User.Identity.Name))
                {
                    TempData.AddErrorMessage($"You are not the owner of the resort");
                    return(RedirectToHome());
                }
            }

            await this.resortService.EditResortAsync(model.Name, id);

            TempData.AddSuccessMessage($"Resort's name was changed to {model.Name}");
            return(RedirectToHome());
        }
        public IActionResult Create(ResortFormServiceModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            this.resortService.Create(model.Name, model.OwnerId);

            TempData.AddSuccessMessage($"Resort {model.Name} was added successfully");
            return(RedirectToHome());
        }