/// <summary> /// Add an orders cart to the database /// </summary> /// <param name="ordersCart">The orders cart that will be saved in the database</param> public void Add(OrdersCart ordersCart) { context.OrdersCarts.Add(ordersCart); context.SaveChanges(); }
/// <summary> /// Get an accounts order cart from the database /// </summary> /// <param name="accountId">The account id used to compare to the account id foreign key in the ordercart table</param> /// <returns>The order cart of the particular user</returns> public OrdersCart GetAnOrdersCart(int accountId) { OrdersCart ordersCart = context.OrdersCarts.Where(a => a.AccountId == accountId).FirstOrDefault(); return(ordersCart); }