Created
July 20, 2016 04:15
-
-
Save simpleprogrammer-shared/6d2fc5e0e822ba994e080572cc3a9d15 to your computer and use it in GitHub Desktop.
3 Simple Techniques to Make APIs Easier to Use and Understand 5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void LoginAsCustomer(LoginInfo loginInfo, CustomerType customerType = CustomerType.NEW_CUSTOMER, int numberOfTries = 3) | |
{ | |
// ... | |
} | |
var loginInfo = new LoginInfo("Darth Vader", "ihatewookes"); | |
LoginAsCustomer(loginInfo); | |
// What if we need to override a default? No problem. | |
LoginAsCustomer(loginInfo, customerType: CustomerType.REWARDS_CUSTOMER); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment