Exemple #1
0
        public void SetHorseAdProfilePicture(int imageId, string userId)
        {
            var image = _iImageDao.GetById(imageId);

            CheckImageAndUserIdentity(image, userId);

            if (image.HorseAd.Images.Any(img => img.IsProfilePic))
            {
                image.HorseAd.Images.Where(img => img.IsProfilePic).ToList().ForEach(x => x.IsProfilePic = false);
            }

            image.IsProfilePic = true;

            _iImageDao.Update(image);
        }