예제 #1
0
        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);
                }
            }
        }
예제 #2
0
 public async Task Remove(RecipeItem item)
 {
     await _sqlCon.DeleteAsync(item);
 }
예제 #3
0
        private void AddCommandExecute()
        {
            var recipeItem = new RecipeItem();

            _navigationService.NavigateTo <RecipeItemViewModel>(recipeItem);
        }