Skip to content
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

When ToInt32OrDefault encounter NULL and "" values, there will be no exception, resulting in the default value not being set normally. #39

Open
att1008 opened this issue Aug 9, 2024 · 0 comments

Comments

@att1008
Copy link

att1008 commented Aug 9, 2024

Here is what to include in your request to make sure we implement a solution as quickly as possible.

1. Description

The default ToInt32OrDefault is to use Convert.ToInt32 instead of int.Parse or int.TryParse. when string is a NULL value or "" value, Convert.ToInt32 does not have an exception but directly returns a 0, which causes the set default value to be unable to be used normally.

2. Exception

If you are seeing an exception, include the full exception details (message and stack trace).

Exception message:
Stack trace:

3. Fiddle or Project

If you are able,

Provide a Fiddle that reproduce the issue: https://dotnetfiddle.net/25Vjsn

Or provide a project/solution that we can run to reproduce the issue.

  • Make sure the project compile
  • Make sure to provide only the code that is required to reproduce the issue, not the whole project
  • You can send private code here: [email protected]

Otherwise, make sure to include as much information as possible to help our team to reproduce the issue.

4. Any further technical details

Add any relevant detail can help us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant