-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-IDEResolution-Won't FixA real bug, but Triage feels that the issue is not impactful enough to spend time on.A real bug, but Triage feels that the issue is not impactful enough to spend time on.
Milestone
Description
To send a nullable int to a SQL database it must been unboxed, cast to object and have null values replaced with DBNull. I created a method to do this in a data access object:
public object SQLNullableObject(int? input)
{
return input.HasValue ? (object)input.Value : (object)DBNull.Value;
}
The compiler shows to suggestions that the cast to object is not required. Both of these fixes appear valid on their own. Applying one removes the other auto-fix, as in both cases this would break the code, as the if statement has to give only one type of output.
Perhaps only one of these changes should be suggested, though I don't know which would be considered the better change if any, or perhaps neither should be suggested for the sake of code clarity.
Metadata
Metadata
Assignees
Labels
Area-IDEResolution-Won't FixA real bug, but Triage feels that the issue is not impactful enough to spend time on.A real bug, but Triage feels that the issue is not impactful enough to spend time on.