Exemplo n.º 1
0
        public bool Delete(int id)
        {
            using (DataModelEntities model = new DataModelEntities())
            {
                bool retVal = false;
                var  item   = model.Item.FirstOrDefault(b => b.Id.Equals(id));

                if (item != null)
                {
                    model.DeleteObject(item);
                    model.SaveChanges();
                    retVal = true;
                }

                return(retVal);
            }
        }
Exemplo n.º 2
0
        public bool Delete(int id)
        {
            using (DataModelEntities model = new DataModelEntities())
            {
                bool retVal         = false;
                var  PaperReference = model.PaperReference.FirstOrDefault(b => b.Id.Equals(id));

                if (PaperReference != null)
                {
                    model.DeleteObject(PaperReference);
                    model.SaveChanges();
                    retVal = true;
                }

                return(retVal);
            }
        }