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
76b930a4
Commit
76b930a4
authored
Oct 29, 2011
by
Sam Saffron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix regression with Guid mapping
parent
86ea6f60
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
SqlMapper.cs
Dapper/SqlMapper.cs
+1
-5
Tests.cs
Tests/Tests.cs
+18
-0
No files found.
Dapper/SqlMapper.cs
View file @
76b930a4
...
@@ -926,11 +926,7 @@ private static CacheInfo GetCacheInfo(Identity identity)
...
@@ -926,11 +926,7 @@ private static CacheInfo GetCacheInfo(Identity identity)
}
}
#endif
#endif
if
(
if
(!
typeMap
.
ContainsKey
(
type
))
(
type
.
IsClass
&&
type
!=
typeof
(
string
)
&&
type
!=
typeof
(
byte
[])
&&
type
!=
typeof
(
System
.
Data
.
Linq
.
Binary
))
||
(
type
.
IsValueType
&&
!
type
.
IsPrimitive
&&
!(
type
.
IsGenericType
&&
type
.
GetGenericTypeDefinition
()
==
typeof
(
Nullable
<>))
&&
type
!=
typeof
(
Guid
))
)
{
{
return
GetTypeDeserializer
(
type
,
reader
,
startBound
,
length
,
returnNullIfFirstMissing
);
return
GetTypeDeserializer
(
type
,
reader
,
startBound
,
length
,
returnNullIfFirstMissing
);
}
}
...
...
Tests/Tests.cs
View file @
76b930a4
...
@@ -16,6 +16,24 @@ class Tests
...
@@ -16,6 +16,24 @@ class Tests
{
{
SqlConnection
connection
=
Program
.
GetOpenConnection
();
SqlConnection
connection
=
Program
.
GetOpenConnection
();
public
void
TestNullableGuidSupport
()
{
var
guid
=
connection
.
Query
<
Guid
?>(
"select null"
).
First
();
guid
.
IsNull
();
guid
=
Guid
.
NewGuid
();
var
guid2
=
connection
.
Query
<
Guid
?>(
"select @guid"
,
new
{
guid
}).
First
();
guid
.
IsEqualTo
(
guid2
);
}
public
void
TestNonNullableGuidSupport
()
{
var
guid
=
Guid
.
NewGuid
();
var
guid2
=
connection
.
Query
<
Guid
?>(
"select @guid"
,
new
{
guid
}).
First
();
Assert
.
IsTrue
(
guid
==
guid2
);
}
struct
Car
struct
Car
{
{
public
enum
TrapEnum
:
int
public
enum
TrapEnum
:
int
...
...
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