public void Add(User user) { using (var connection = new SqlConnection(_connectionString)) { var command = new SqlCommand("INSERT INTO [Users] (Name, Password) VALUES (@Name, @Password)", connection); command.Parameters.Add(new SqlParameter("@Name", user.Name)); command.Parameters.Add(new SqlParameter("@Password", user.Password)); connection.Open(); command.ExecuteNonQuery(); } }
public void CreateUser(User user) { Dao.UserAccess.Add(user); }