Exemple #1
0
        public void InsertRecord(tblHospital obj)
        {
            //obj.ID = 18;

            db.tblHospitals.Add(obj);
            db.SaveChanges();
        }
Exemple #2
0
        public void UpdateRecord(tblHospital obj)
        {
            db.tblHospitals.Attach(obj);
            var update = db.Entry(obj);

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

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