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; } } }
public User UpdateUser(User user) { return _userRepository.Update(user); }
public void DeleteUser(User user) { this.DeleteUser(user.UserId); }
public User AddUser(User user) { return _userRepository.Add(user); }
public User Update(User user) { //implementation return user; }
public User Add(User user) { //implementation return user; }