public async Task Insert(RecipeItem item) { using (await Mutex.LockAsync().ConfigureAwait(false)) { var existingTodoItem = await _sqlCon.Table <RecipeItem>() .Where(x => x.Id == item.Id) .FirstOrDefaultAsync(); if (existingTodoItem == null) { await _sqlCon.InsertAsync(item).ConfigureAwait(false); } else { item.Id = existingTodoItem.Id; await _sqlCon.UpdateAsync(item).ConfigureAwait(false); } } }
public async Task Remove(RecipeItem item) { await _sqlCon.DeleteAsync(item); }
private void AddCommandExecute() { var recipeItem = new RecipeItem(); _navigationService.NavigateTo <RecipeItemViewModel>(recipeItem); }