示例#1
0
        public bool Update(User user)
        {
            try
            {
                User usertoupdate = _manager.Users.Find(user.Id);
                _manager.Entry(usertoupdate).CurrentValues.SetValues(user);
                _manager.SaveChanges();
                return(true);
            }

            catch (Exception e)
            {
                return(false);
            }
        }
示例#2
0
        public bool Update(Theme theme)
        {
            try
            {
                Theme themetoupdate = _manager.Themes.Find(theme.Id);
                _manager.Entry(themetoupdate).CurrentValues.SetValues(theme);
                _manager.SaveChanges();
                return(true);
            }

            catch (Exception e)
            {
                return(false);
            }
        }
示例#3
0
        public bool Update(Film film)
        {
            try
            {
                Film filmtoupdate = _manager.Films.Find(film.Id);
                _manager.Entry(filmtoupdate).CurrentValues.SetValues(film);
                _manager.SaveChanges();
                return(true);
            }

            catch (Exception e)
            {
                return(false);
            }
        }