private async void OnSaveClicked(object sender, EventArgs e) { if (string.IsNullOrEmpty(NewJoke.Text)) { return; } var joke = new Joke { Content = NewJoke.Text }; await App.Database.SaveJokeAsync(joke); ListView.ItemsSource = await App.Database.GetJokesAsync(); }
public Task <int> SaveJokeAsync(Joke joke) { return(Database.InsertAsync(joke)); }