public bool DeleteShoppingCart(ShoppingCart shoppingCart) { _rShoppingCart.Remove(shoppingCart); var result = _uow.SaveChanges(); if (result > 0) return true; else return false; }
public bool SaveShoppingCart(ShoppingCart shoppingCart) { try { if (shoppingCart.Id == 0) { _rShoppingCart.Add(shoppingCart); } else { _uow.Entry(shoppingCart).State = EntityState.Modified; } var result = _uow.SaveChanges(); if (result > 0) return true; else return false; } catch (Exception) { return false; } }