Example #1
0
 public IActionResult RemoverFoto(Foto foto)
 {
     foto = _fotoService.Buscar(foto.Id);
     _fotoService.Deletar(foto.Id);
     FileServerService.DeleteFile(InfraStructure.AzureStorage.Properties.Resources.AzureBlobContainer, foto.FotoUrl.Substring(62).Split("_")[0].ToString());
     _session.SetString("Alertas", "Muito bem!!!|VocĂȘ acabou de excluir uma foto!");
     return(RedirectToAction("Index"));
 }
        public IActionResult RemoverFoto(Foto foto)
        {
            var token = _apiIdentificacao.Login(_session.GetString("username"), _session.GetString("password")).Result;

            foto = _apiCoreFoto.BuscarFoto(foto.Id, token).Result;
            _apiCoreFoto.Deletar(foto, token);
            FileServerService.DeleteFile(InfraStructure.AzureStorage.Properties.Resources.AzureBlobContainer, foto.FotoUrl.Substring(62).Split("_")[0].ToString());
            _session.SetString("Alertas", "Muito bem!!!|VocĂȘ acabou de excluir uma foto!");
            return(RedirectToAction("Index"));
        }