Exemple #1
0
        public async Task AddImageToUserAsync(string email, string imageUrl)
        {
            var user = await _userRepository.GetByEmailAsync(email);

            var urlForSave = imageUrl.Replace(ReplacedChar, CharForReplace);
            var image      = new Image
            {
                AppUserId = user.Id,
                Path      = urlForSave,
            };

            var createdImage = await _imageRepository.CreateAsync(image);

            createdImage.Path = CreateImage(createdImage.Id, imageUrl);
            await _imageRepository.UpdateAsync(createdImage);

            await _notificationService.AddNotificationsForUserAsync(user.Id, createdImage.Id);
        }