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
bc5bcf50
Commit
bc5bcf50
authored
Apr 04, 2011
by
Sam Saffron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Rob's massive ORM
parent
c3b7b399
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
439 additions
and
2 deletions
+439
-2
Massive.cs
Massive/Massive.cs
+426
-0
PerformanceTests.cs
PerformanceTests.cs
+9
-0
Program.cs
Program.cs
+2
-1
SqlMapper.cs
SqlMapper.cs
+1
-1
SqlMapper.csproj
SqlMapper.csproj
+1
-0
No files found.
Massive/Massive.cs
0 → 100644
View file @
bc5bcf50
This diff is collapsed.
Click to expand it.
PerformanceTests.cs
View file @
bc5bcf50
...
...
@@ -6,6 +6,7 @@
using
SqlMapper.Linq2Sql
;
using
System.Data.Linq
;
using
System.Diagnostics
;
using
Massive
;
namespace
SqlMapper
{
...
...
@@ -89,6 +90,14 @@ public void Run(int iterations)
var
mapperConnection
=
Program
.
GetOpenConnection
();
tests
.
Add
(
id
=>
mapperConnection
.
ExecuteMapperQuery
<
Post
>(
"select * from Posts where Id = @Id"
,
new
{
Id
=
id
}).
ToList
(),
"Mapper Query"
);
var
mapperConnection2
=
Program
.
GetOpenConnection
();
tests
.
Add
(
id
=>
mapperConnection2
.
ExecuteMapperQuery
(
"select * from Posts where Id = @Id"
,
new
{
Id
=
id
}).
ToList
(),
"Dynamic Mapper Query"
);
var
massiveConnection
=
new
DynamicModel
(
Program
.
connectionString
);
tests
.
Add
(
id
=>
massiveConnection
.
Query
(
"select * from Posts where Id = @0"
,
id
).
ToList
(),
"Dynamic Massive ORM Query"
);
// HAND CODED
var
connection
=
Program
.
GetOpenConnection
();
...
...
Program.cs
View file @
bc5bcf50
...
...
@@ -32,10 +32,11 @@ class Post
class
Program
{
public
static
readonly
string
connectionString
=
"Data Source=.;Initial Catalog=tempdb;Integrated Security=True"
;
public
static
SqlConnection
GetOpenConnection
()
{
var
connection
=
new
SqlConnection
(
"Data Source=.;Initial Catalog=tempdb;Integrated Security=True"
);
var
connection
=
new
SqlConnection
(
connectionString
);
connection
.
Open
();
return
connection
;
}
...
...
SqlMapper.cs
View file @
bc5bcf50
...
...
@@ -163,7 +163,7 @@ private static object GetDynamicDeserializer(SqlDataReader reader)
int
i
=
0
;
foreach
(
var
colName
in
colNames
)
{
var
tmp
=
r
eader
.
GetValue
(
i
);
var
tmp
=
r
.
GetValue
(
i
);
row
[
colName
]
=
tmp
==
DBNull
.
Value
?
null
:
tmp
;
i
++;
}
...
...
SqlMapper.csproj
View file @
bc5bcf50
...
...
@@ -59,6 +59,7 @@
<DependentUpon>
DataClasses.dbml
</DependentUpon>
</Compile>
<Compile
Include=
"Linq2Sql\Post.cs"
/>
<Compile
Include=
"Massive\Massive.cs"
/>
<Compile
Include=
"PerformanceTests.cs"
/>
<Compile
Include=
"Program.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
...
...
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