if (photoResult.Error != null)
{
ModelState.AddModelError("Image", "Unable to upload photo");
return View(_CVM);
}
if (clubUploadingImage.Image == null)
{
_ = await _photoService.DeletePhotoAsync(clubUploadingImage.Image);
}
var updateClubImage = new Club()
{
Id = _CVM.Id,
Title = _CVM.Title,
Description = _CVM.Description,
Image = photoResult.Url.ToString(),
AddressId = _CVM.AddressId,
Address = _CVM.Address,
ClubCategory = _CVM.ClubCategory,
};
_clubRepository.Update(updateClubImage);
return RedirectToAction("Index");
}
if (photoResult.Error != null)
{
ModelState.AddModelError("Image", "Unable to upload photo");
return View(_CVM);
}
if (clubUploadingImage.Image == null)
{
_ = await _photoService.DeletePhotoAsync(clubUploadingImage.Image);
}
var updateClubImage = new Club()
{
Id = _CVM.Id,
Title = _CVM.Title,
Description = _CVM.Description,
Image = photoResult.Url.ToString(),
AddressId = _CVM.AddressId,
Address = _CVM.Address,
ClubCategory = _CVM.ClubCategory,
};
_clubRepository.Update(updateClubImage);
return RedirectToAction("Index");
}