Exemple #1
0
        private bool atualizar(HomePopup OHomePopup)
        {
            HomePopup dbHomePopup = this.carregar(OHomePopup.id);

            if (dbHomePopup == null)
            {
                return(false);
            }

            var TipoEntry = db.Entry(dbHomePopup);

            OHomePopup.setDefaultUpdateValues <HomePopup>();
            TipoEntry.CurrentValues.SetValues(OHomePopup);
            TipoEntry.State = System.Data.Entity.EntityState.Modified;
            TipoEntry.ignoreFields <HomePopup>();

            db.SaveChanges();
            return(OHomePopup.id > 0);
        }