public void Update(User user) { using (IDbConnection db = Connection) { var sqlQuerry = "UPDATE users SET username = @username, passwordhash = @passwordhash, salt = @salt WHERE id = @Id"; db.Execute(sqlQuerry, new { username = user.Username, passwordhash = user.GetPasswordHash(), salt = user.GetSalt() }); } }
public void Register(User user) { using (IDbConnection db = Connection) { var sqlQuerry = "INSERT INTO users (username, passwordhash, salt) VALUES(@username, @passwordhash, @salt)"; db.Execute(sqlQuerry, new { username = user.Username, passwordhash = user.GetPasswordHash(), salt = user.GetSalt() }); } }