Exemple #1
0
        public bool Delete(int shoppingItemId)
        {
            var dbContext = new ShoppingListDbContext();

            var shoppingItemSqlStorage = new ShoppingItemSqlStorage(dbContext);

            return(new ShoppingItem().DeleteItem(shoppingItemId, shoppingItemSqlStorage));
        }
Exemple #2
0
        public ShoppingItem AddUpdate(ShoppingItem shoppingItem)
        {
            var dbContext = new ShoppingListDbContext();

            var shoppingItemSqlStorage = new ShoppingItemSqlStorage(dbContext);

            var itemToUpdate = shoppingItemSqlStorage.GetById(shoppingItem.Id);

            itemToUpdate.AddUpdateItem(shoppingItem, shoppingItemSqlStorage);
            return(itemToUpdate);
        }