Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

@kkurni
Copy link
Contributor

@kkurni kkurni commented Mar 17, 2016

Revert back the logic as close as current net framework.
Because it doesn't count if the the type is enum.

In corefx, we cannot get GetTypeCode from Type. But we can get this from the value/instance by using Convert.GetTypeCode(value).

If it is enum type, Convert.GetTypeCode will called IConvertible.GetTypeCode which implemented in Enum Type to get the underlying type.

@kkurni
Copy link
Contributor Author

kkurni commented Mar 17, 2016

CC @corivera @saurabh500 @YoungGah

@kkurni
Copy link
Contributor Author

kkurni commented Mar 17, 2016

This will fix this issue https://github.com/dotnet/corefx/issues/1613


if (dataType == typeof (System.Byte[]))
{
// mdac 90455 must not default to image if inferLen is false ...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment should be removed.

@saurabh500
Copy link
Contributor

@dotnet-bot Test Innerloop Windows_NT Release Build and Test please

@saurabh500
Copy link
Contributor

@kkurni There are some comments which need to be cleaned up.

Otherwise LGTM.

This logic is the same as .net 4.5 but it use Convert.GetTypeCode instead of Type.GetTypeCode.
kkurni added a commit that referenced this pull request Mar 18, 2016
Fix SqlParameter Validation for Enum Type.
@kkurni kkurni merged commit a35d28d into dotnet:master Mar 18, 2016
@karelz karelz modified the milestone: 1.0.0-rtm Dec 3, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants