public IQueryable <Category> GetCategories() { var _db = new AppBackToReality.Models.ScreenContext(); IQueryable <Category> query = _db.Categories; return(query); }
public IQueryable <Screen> GetScreens() { var _db = new AppBackToReality.Models.ScreenContext(); IQueryable <Screen> query = _db.Screens; return(query); }
public void RemoveItem(string removeCartID, int removeScreenID) { using (var _db = new AppBackToReality.Models.ScreenContext()) { try { var myItem = (from c in _db.ShoppingCartItems where c.CartId == removeCartID && c.Screen.ScreenID == removeScreenID select c).FirstOrDefault(); if (myItem != null) { // Remove Item. _db.ShoppingCartItems.Remove(myItem); _db.SaveChanges(); } } catch (Exception exp) { throw new Exception("ERROR: Unable to Remove Cart Item - " + exp.Message.ToString(), exp); } } }