コード例 #1
0
        public void Update(User entity)
        {
            User user = _context.Find <User>(entity.Id);

            user.FirstName = entity.FirstName;
            user.LastName  = entity.LastName;
            user.Username  = entity.Username;
            user.Password  = entity.Password;
            user.Notes     = entity.Notes;

            _context.Update(user);
        }
コード例 #2
0
        public void Update(int userId)
        {
            User user = _context.Set <User>()
                        .Include(u => u.Notes)
                        .Single(u => u.Id == userId);

            user.FirstName = entity.FirstName;
            user.LastName  = entity.LastName;
            user.Username  = entity.Username;
            user.Password  = entity.Password;
            user.Notes     = entity.Notes;

            _context.Update(user);
        }
コード例 #3
0
        public void Update(User entity)
        {
            User user = _context.Set <User>()
                        .Include(u => u.Notes)
                        .SingleOrDefault(u => u.Username == entity.Username);

            user.Id        = entity.Id;
            user.FirstName = entity.FirstName;
            user.LastName  = entity.LastName;
            user.Username  = entity.Username;
            user.Password  = entity.Password;
            user.Notes     = entity.Notes;

            _context.Update(user);
        }
コード例 #4
0
 public void Update(Note entity)
 {
     _context.Update(entity);
 }