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)); }
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); } }