Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
Dapper
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
Dapper
Commits
34371620
Commit
34371620
authored
May 05, 2015
by
Marc Gravell
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'BrannJoly-fix_SO27024806'
parents
8848e37e
78b0f54d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
SqlMapper.cs
Dapper NET40/SqlMapper.cs
+2
-1
Tests.cs
Tests/Tests.cs
+19
-0
No files found.
Dapper NET40/SqlMapper.cs
View file @
34371620
...
...
@@ -5297,7 +5297,8 @@ public ConstructorInfo FindConstructor(string[] names, Type[] types)
var
unboxedType
=
Nullable
.
GetUnderlyingType
(
ctorParameters
[
i
].
ParameterType
)
??
ctorParameters
[
i
].
ParameterType
;
if
(
unboxedType
!=
types
[
i
]
&&
!(
unboxedType
.
IsEnum
&&
Enum
.
GetUnderlyingType
(
unboxedType
)
==
types
[
i
])
&&
!(
unboxedType
==
typeof
(
char
)
&&
types
[
i
]
==
typeof
(
string
)))
&&
!(
unboxedType
==
typeof
(
char
)
&&
types
[
i
]
==
typeof
(
string
))
&&
!(
unboxedType
.
IsEnum
&&
types
[
i
]
==
typeof
(
string
)))
break
;
}
...
...
Tests/Tests.cs
View file @
34371620
...
...
@@ -3526,6 +3526,25 @@ public void SO24740733_TestCustomValueHandler()
foo
.
CategoryRating
.
Value
.
IsEqualTo
(
200
);
}
enum
SO27024806Enum
{
Foo
,
Bar
}
private
class
SO27024806Class
{
public
SO27024806Class
(
SO27024806Enum
myField
)
{
this
.
MyField
=
myField
;
}
public
SO27024806Enum
MyField
{
get
;
set
;
}
}
public
void
SO27024806_TestVarcharEnumMemberWithExplicitConstructor
()
{
var
foo
=
connection
.
Query
<
SO27024806Class
>(
"SELECT 'Foo' AS myField"
).
Single
();
foo
.
MyField
.
IsEqualTo
(
SO27024806Enum
.
Foo
);
}
public
void
SO24740733_TestCustomValueSingleColumn
()
{
Dapper
.
SqlMapper
.
AddTypeHandler
(
RatingValueHandler
.
Default
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment