Exemple #1
0
 public bool EditBlog(int BlogId, Blog blog)
 {
     if (_context.Blogs.Find(blog.BlogId) != null)
     {
         Blog btemp = _context.Blogs.First(b => b.BlogId == BlogId);
         _context.Update(btemp);
         btemp = blog;
         _context.SaveChanges();
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemple #2
0
        public bool EditUser(int key, User user)
        {
            if (Search(key) != null)
            {
                User currentUser = Search(key);
                _context.Update(currentUser);
                currentUser = user;
                _context.SaveChanges();

                return(true);
            }
            return(false);
        }