Example #1
0
        public int AddTest(tblTest obj)
        {
            //obj.ID = 18;

            db.tblTests.Add(obj);
            db.SaveChanges();
            return(obj.ID);
        }
Example #2
0
        public void UpdateTest(tblTest obj)
        {
            db.tblTests.Attach(obj);
            var update = db.Entry(obj);

            update.Property(x => x.Description).IsModified = true;

            update.Property(x => x.TestCategoryID).IsModified = true;
            update.Property(x => x.TestName).IsModified       = true;
            db.SaveChanges();
        }