private async void AddImageToServer() { var imageArray = FromFile.ToArray(file.GetStream()); //convert image stream to byte array; file.Dispose(); var response = await ApiService.AddImage(_postId, imageArray); if (response) { return; } await DisplayAlert("Something went wrong", "Upload again", "Cancel"); }
private async void AddImageToServer() { var imageArray = FromFile.ToArray(file.GetStream()); file.Dispose(); var response = await ApiService.AddImage(_vehicleId, imageArray); if (response) { return; } await DisplayAlert("Something wrong", "Please upload the image again", "Alright"); }
//metodo para adicionar a imagem para o server private async void AddImageToServer() { var ImageArray = FromFile.ToArray(file.GetStream()); file.Dispose(); var resposta = await ApiService.AddImage(_veiculoId, ImageArray); if (resposta) { return; } await DisplayAlert("Algo deu errado", "Por favor envie a foto novamente", "OK"); }