-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try based lookup methods #50
Conversation
I can add Try... methods to the other lookup types as well if wanted. |
Thanks! Please do add them for all the database types along with corresponding unit tests. |
Updated. |
/// <param name="ipAddress">The IP address.</param> | ||
/// <param name="response">The <see cref="AnonymousIPResponse" />.</param> | ||
/// <returns>A <see cref="bool" /> describing whether the IP address was found.</returns> | ||
public bool TryAnonymousIP(string ipAddress, out AnonymousIPResponse response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some of these, there is only a method that takes a string
IP and for others the method takes only an IPAddress
. We should have both or at least be consistent.
All set now. You're right, I missed some of the methods in that class. Added the missing method overloads, organized the class better so the base methods are at the end and refactored the database reader unit tests too. |
Thanks! I merged this and did a beta release. |
Refers to #31
Added new
TryCity
andTryCountry
methods that don't throw an exception when the IP address cannot be found. This avoids using exceptions for flow control.