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
4bfa979d
Commit
4bfa979d
authored
Sep 15, 2014
by
Marc Gravell
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ronindev-master'
parents
f8ce0e45
bbbe18d5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
7 deletions
+22
-7
SqlMapper.cs
Dapper NET40/SqlMapper.cs
+1
-1
Tests.cs
DapperTests NET45/Tests.cs
+21
-6
No files found.
Dapper NET40/SqlMapper.cs
View file @
4bfa979d
...
...
@@ -2674,7 +2674,7 @@ private static IEnumerable<PropertyInfo> FilterParameters(IEnumerable<PropertyIn
// look for ? / @ / : *by itself*
static
readonly
Regex
smellsLikeOleDb
=
new
Regex
(
@"(?<![a-zA-Z0-9
_])[?@:](?![a-zA-Z0-9
_])"
,
RegexOptions
.
IgnoreCase
|
RegexOptions
.
Multiline
|
RegexOptions
.
CultureInvariant
|
RegexOptions
.
Compiled
),
static
readonly
Regex
smellsLikeOleDb
=
new
Regex
(
@"(?<![a-zA-Z0-9
@_])[?@:](?![a-zA-Z0-9@
_])"
,
RegexOptions
.
IgnoreCase
|
RegexOptions
.
Multiline
|
RegexOptions
.
CultureInvariant
|
RegexOptions
.
Compiled
),
literalTokens
=
new
Regex
(
@"\{=([a-zA-Z0-9_]+)\}"
,
RegexOptions
.
IgnoreCase
|
RegexOptions
.
Multiline
|
RegexOptions
.
CultureInvariant
|
RegexOptions
.
Compiled
);
/// <summary>
...
...
DapperTests NET45/Tests.cs
View file @
4bfa979d
...
...
@@ -33,7 +33,7 @@ public void TestBasicStringUsageAsyncNonBuffered()
public
void
TestLongOperationWithCancellation
()
{
using
(
var
connection
=
Program
.
GetClosedConnection
())
using
(
var
connection
=
Program
.
GetClosedConnection
())
{
CancellationTokenSource
cancel
=
new
CancellationTokenSource
(
TimeSpan
.
FromSeconds
(
5
));
var
task
=
connection
.
QueryAsync
<
int
>(
new
CommandDefinition
(
"waitfor delay '00:00:10';select 1"
,
cancellationToken
:
cancel
.
Token
));
...
...
@@ -531,7 +531,7 @@ public void TestSupportForDynamicParametersOutputExpressions_QueryMultiple()
p
.
Output
(
bob
,
b
=>
b
.
Address
.
PersonId
);
int
x
,
y
;
using
(
var
multi
=
connection
.
QueryMultipleAsync
(
@"
using
(
var
multi
=
connection
.
QueryMultipleAsync
(
@"
SET @Occupation = 'grillmaster'
SET @PersonId = @PersonId + 1
SET @NumberOfLegs = @NumberOfLegs - 1
...
...
@@ -561,7 +561,7 @@ public void TestSubsequentQueriesSuccess()
var
data0
=
connection
.
QueryAsync
<
Foo0
>(
"select 1 as [Id] where 1 = 0"
).
Result
.
ToList
();
data0
.
Count
().
IsEqualTo
(
0
);
var
data1
=
connection
.
QueryAsync
<
Foo1
>(
new
CommandDefinition
(
"select 1 as [Id] where 1 = 0"
,
flags
:
CommandFlags
.
Buffered
)).
Result
.
ToList
();
var
data1
=
connection
.
QueryAsync
<
Foo1
>(
new
CommandDefinition
(
"select 1 as [Id] where 1 = 0"
,
flags
:
CommandFlags
.
Buffered
)).
Result
.
ToList
();
data1
.
Count
().
IsEqualTo
(
0
);
var
data2
=
connection
.
QueryAsync
<
Foo2
>(
new
CommandDefinition
(
"select 1 as [Id] where 1 = 0"
,
flags
:
CommandFlags
.
None
)).
Result
.
ToList
();
...
...
@@ -578,7 +578,7 @@ public void TestSubsequentQueriesSuccess()
}
}
class
Foo0
{
public
int
Id
{
get
;
set
;
}
}
class
Foo0
{
public
int
Id
{
get
;
set
;
}
}
class
Foo1
{
public
int
Id
{
get
;
set
;
}
}
class
Foo2
{
public
int
Id
{
get
;
set
;
}
}
class
Person
...
...
@@ -700,8 +700,23 @@ public void TestMultiMapArbitraryMaps()
finally
{
connection
.
Execute
(
"drop table #Users drop table #ReviewBoards"
);
}
}
}
public
void
TestAtEscaping
()
{
using
(
var
connection
=
Program
.
GetOpenConnection
())
{
var
id
=
connection
.
QueryAsync
<
int
>(
@"
declare @@Name int
select @@Name = @Id+1
select @@Name
"
,
new
Product
{
Id
=
1
}).
Result
.
Single
();
id
.
IsEqualTo
(
2
);
}
}
}
}
\ No newline at end of file
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