Example #1
0
        public bool Delete(devices obj)
        {
            EDM edm = new EDM();

            edm.Entry(obj).State = System.Data.Entity.EntityState.Deleted;
            try
            {
                edm.SaveChanges();
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
        public Int32 Create(devices obj)
        {
            EDM edm = new EDM();

            edm.devices.Add(obj);
            try
            {
                edm.SaveChanges();
                return(obj.id);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }