public async Task UpdateAsync(UsuarioModel usuarioModel, string base64)
        {
            if (base64 != null)
            {
                if (usuarioModel.FotoPerfil != null)
                {
                    await _blobServices.DeleteBlobAsync(usuarioModel.FotoPerfil);
                }

                var blob = await _blobServices.CreateBlobAsync(base64);

                usuarioModel.FotoPerfil = blob;
            }

            await _usuarioRepository.UpdateAsync(usuarioModel);
        }
Beispiel #2
0
        public async Task DeleteAsync(int id, string uri)
        {
            var comentarios = await _commentPostRepository.GetPostByIdAsync(id);

            var likes = await _likePostRepository.GetPostByIdAsync(id);


            foreach (var comentario in comentarios)
            {
                await _commentPostRepository.DeleteAsync(comentario.Id);
            }

            foreach (var like in likes)
            {
                await _likePostRepository.DeleteAsync(like.Id);
            }

            await _postRepository.DeleteAsync(id);

            if (uri != null)
            {
                await _blobServices.DeleteBlobAsync(uri);
            }
        }