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
36f51540
Commit
36f51540
authored
Feb 27, 2013
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http://code.google.com/p/dapper-dot-net/issues/detail?id=132
- EF change patches
@david.obando
parent
6950c694
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
SqlMapper.cs
Dapper/SqlMapper.cs
+3
-1
PerformanceTests.cs
Tests/PerformanceTests.cs
+3
-3
No files found.
Dapper/SqlMapper.cs
View file @
36f51540
...
@@ -409,7 +409,9 @@ static SqlMapper()
...
@@ -409,7 +409,9 @@ static SqlMapper()
typeMap
[
typeof
(
TimeSpan
?)]
=
DbType
.
Time
;
typeMap
[
typeof
(
TimeSpan
?)]
=
DbType
.
Time
;
typeMap
[
typeof
(
Object
)]
=
DbType
.
Object
;
typeMap
[
typeof
(
Object
)]
=
DbType
.
Object
;
}
}
/// <summary>
/// Configire the specified type to be mapped to a given db-type
/// </summary>
public
static
void
AddTypeMap
(
Type
type
,
DbType
dbType
)
public
static
void
AddTypeMap
(
Type
type
,
DbType
dbType
)
{
{
typeMap
[
type
]
=
dbType
;
typeMap
[
type
]
=
dbType
;
...
...
Tests/PerformanceTests.cs
View file @
36f51540
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Data
;
using
System.Data
;
using
System.Data.Linq
;
using
System.Data.Linq
;
...
@@ -120,7 +120,7 @@ public void Run(int iterations)
...
@@ -120,7 +120,7 @@ public void Run(int iterations)
var
entityContext5
=
new
EntityFramework
.
tempdbEntities1
();
var
entityContext5
=
new
EntityFramework
.
tempdbEntities1
();
entityContext5
.
Connection
.
Open
();
entityContext5
.
Connection
.
Open
();
entityContext5
.
Posts
.
MergeOption
=
System
.
Data
.
Objects
.
MergeOption
.
NoTracking
;
entityContext5
.
Posts
.
MergeOption
=
System
.
Data
.
Objects
.
MergeOption
.
NoTracking
;
tests
.
Add
(
id
=>
entityContext
.
Posts
.
First
(
p
=>
p
.
Id
==
id
),
"Entity framework No Tracking"
);
tests
.
Add
(
id
=>
entityContext
5
.
Posts
.
First
(
p
=>
p
.
Id
==
id
),
"Entity framework No Tracking"
);
var
mapperConnection
=
Program
.
GetOpenConnection
();
var
mapperConnection
=
Program
.
GetOpenConnection
();
tests
.
Add
(
id
=>
mapperConnection
.
Query
<
Post
>(
"select * from Posts where Id = @Id"
,
new
{
Id
=
id
},
buffered
:
true
).
First
(),
"Mapper Query (buffered)"
);
tests
.
Add
(
id
=>
mapperConnection
.
Query
<
Post
>(
"select * from Posts where Id = @Id"
,
new
{
Id
=
id
},
buffered
:
true
).
First
(),
"Mapper Query (buffered)"
);
...
@@ -128,7 +128,7 @@ public void Run(int iterations)
...
@@ -128,7 +128,7 @@ public void Run(int iterations)
var
mapperConnection2
=
Program
.
GetOpenConnection
();
var
mapperConnection2
=
Program
.
GetOpenConnection
();
tests
.
Add
(
id
=>
mapperConnection2
.
Query
(
"select * from Posts where Id = @Id"
,
new
{
Id
=
id
},
buffered
:
true
).
First
(),
"Dynamic Mapper Query (buffered)"
);
tests
.
Add
(
id
=>
mapperConnection2
.
Query
(
"select * from Posts where Id = @Id"
,
new
{
Id
=
id
},
buffered
:
true
).
First
(),
"Dynamic Mapper Query (buffered)"
);
tests
.
Add
(
id
=>
mapperConnection2
.
Query
(
"select * from Posts where Id = @Id"
,
new
{
Id
=
id
},
buffered
:
true
).
First
(),
"Dynamic Mapper Query (non-buffered)"
);
tests
.
Add
(
id
=>
mapperConnection2
.
Query
(
"select * from Posts where Id = @Id"
,
new
{
Id
=
id
},
buffered
:
false
).
First
(),
"Dynamic Mapper Query (non-buffered)"
);
// dapper.contrib
// dapper.contrib
var
mapperConnection3
=
Program
.
GetOpenConnection
();
var
mapperConnection3
=
Program
.
GetOpenConnection
();
...
...
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