Esempio n. 1
0
        public SpecialProduct GetEntity(object id)
        {
            SpecialProductKey key = (SpecialProductKey)id;

            //return db.SpecialProduct.Include(x => x.Product).Include(x => x.Customer)
            //    .SingleOrDefault(x => new { x.ProductId, x.CustomerId } == id);
            return(db.SpecialProduct.Find(key.ProductId, key.CustomerId));
        }
Esempio n. 2
0
        public void Delete(object id)
        {
            SpecialProductKey key            = (SpecialProductKey)id;
            SpecialProduct    specialProduct = db.SpecialProduct
                                               .Find(key.ProductId, key.CustomerId);

            if (specialProduct != null)
            {
                db.SpecialProduct.Remove(specialProduct);
            }
        }