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
808c2708
Commit
808c2708
authored
May 06, 2015
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix boolean literal replacement in IL-based IMPL; 1.41-beta5 release
parent
e9313a71
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
SqlMapper.cs
Dapper NET40/SqlMapper.cs
+8
-0
project.json
Dapper/project.json
+1
-1
Tests.cs
Tests/Tests.cs
+9
-1
No files found.
Dapper NET40/SqlMapper.cs
View file @
808c2708
...
...
@@ -3314,6 +3314,14 @@ internal static IList<LiteralToken> GetLiteralTokens(string sql)
switch
(
typeCode
)
{
case
TypeCode
.
Boolean
:
Label
ifTrue
=
il
.
DefineLabel
(),
allDone
=
il
.
DefineLabel
();
il
.
Emit
(
OpCodes
.
Brtrue_S
,
ifTrue
);
il
.
Emit
(
OpCodes
.
Ldstr
,
"0"
);
il
.
Emit
(
OpCodes
.
Br_S
,
allDone
);
il
.
MarkLabel
(
ifTrue
);
il
.
Emit
(
OpCodes
.
Ldstr
,
"1"
);
il
.
MarkLabel
(
allDone
);
break
;
case
TypeCode
.
Byte
:
case
TypeCode
.
SByte
:
case
TypeCode
.
UInt16
:
...
...
Dapper/project.json
View file @
808c2708
...
...
@@ -5,7 +5,7 @@
"licenseUrl"
:
"http://www.apache.org/licenses/LICENSE-2.0"
,
"summary"
:
"A high performance Micro-ORM"
,
"description"
:
"A high performance Micro-ORM supporting Sql Server, MySQL, Sqlite, SqlCE, Firebird etc.."
,
"version"
:
"1.41-beta
4
"
,
"version"
:
"1.41-beta
5
"
,
"compile"
:
[
"../Dapper NET40/*.cs"
,
"../Dapper NET45/*.cs"
],
"title"
:
"Dapper dot net"
,
"tags"
:
[
"orm"
,
"sql"
,
"micro-orm"
],
...
...
Tests/Tests.cs
View file @
808c2708
...
...
@@ -3223,7 +3223,15 @@ public void LiteralReplacementDynamicEnumAndString()
y
.
Equals
(
123.45
M
);
z
.
Equals
(
AnotherEnum
.
A
);
}
public
void
LiteralReplacementBoolean
()
{
var
row
=
connection
.
Query
<
int
?>(
"select 42 where 1 = {=val}"
,
new
{
val
=
true
}).
SingleOrDefault
();
row
.
IsNotNull
();
row
.
IsEqualTo
(
42
);
row
=
connection
.
Query
<
int
?>(
"select 42 where 1 = {=val}"
,
new
{
val
=
false
}).
SingleOrDefault
();
row
.
IsNull
();
}
public
void
LiteralReplacementWithIn
()
{
var
data
=
connection
.
Query
<
MyRow
>(
"select @x where 1 in @ids and 1 ={=a}"
,
...
...
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