Пример #1
0
        public User GetSingle(int id)
        {
            using (var conn = _connFactory.CreateConnection())
            {
                var command = new SqlCommand("Select * from Users where UserId = @id");

                using (var reader = command.ExecuteReader(CommandBehavior.SingleResult))
                {
                    var user = new User();

                    if (reader.Read())
                    {
                        user.MapFromDB((IDataRecord)reader);
                    }

                    return user;
                }
            }
        }
Пример #2
0
 public User UpdateUser(User user)
 {
     return _userRepository.Update(user);
 }
Пример #3
0
 public void DeleteUser(User user)
 {
     this.DeleteUser(user.UserId);
 }
Пример #4
0
 public User AddUser(User user)
 {
     return _userRepository.Add(user);
 }
Пример #5
0
 public User Update(User user)
 {
     //implementation
     return user;
 }
Пример #6
0
 public User Add(User user)
 {
     //implementation
     return user;
 }