Example #1
0
        public CartPart GetWholeEntity(object id)
        {
            CartPartKey key = (CartPartKey)id;

            return(db.CartPart.Include(x => x.Cart).Include(x => x.Menu)
                   .SingleOrDefault(x => x.MenuId == key.MenuId & x.CartId == key.CartId));
        }
Example #2
0
        public CartPart GetEntity(object id)
        {
            CartPartKey key = (CartPartKey)id;

            //return db.CartPart.Include(x => x.Cart).Include(x => x.Menu)
            //    .SingleOrDefault(x => new { x.MenuId, x.CartId } == id);
            return(db.CartPart.Find(key.MenuId, key.CartId));
        }
Example #3
0
        public void Delete(object id)
        {
            CartPartKey key      = (CartPartKey)id;
            CartPart    cartPart = db.CartPart.Find(key.MenuId, key.CartId);

            if (cartPart != null)
            {
                db.CartPart.Remove(cartPart);
            }
        }