public bool Delete(int shoppingItemId) { var dbContext = new ShoppingListDbContext(); var shoppingItemSqlStorage = new ShoppingItemSqlStorage(dbContext); return(new ShoppingItem().DeleteItem(shoppingItemId, shoppingItemSqlStorage)); }
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); }