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
f8ce0e45
Commit
f8ce0e45
authored
Sep 15, 2014
by
Marc Gravell
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:StackExchange/dapper-dot-net
parents
b2952360
5bad74f1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
Database.cs
Dapper.Rainbow/Database.cs
+2
-2
SqlCompactDatabase.cs
Dapper.Rainbow/SqlCompactDatabase.cs
+1
-1
dapper.nuspec
dapper.nuspec
+2
-2
No files found.
Dapper.Rainbow/Database.cs
View file @
f8ce0e45
...
...
@@ -56,7 +56,7 @@ public string TableName
List
<
string
>
paramNames
=
GetParamNames
(
o
);
paramNames
.
Remove
(
"Id"
);
string
cols
=
string
.
Join
(
","
,
paramNames
);
string
cols
=
string
.
Join
(
","
,
paramNames
.
Select
(
p
=>
"["
+
p
+
"]"
)
);
string
cols_params
=
string
.
Join
(
","
,
paramNames
.
Select
(
p
=>
"@"
+
p
));
var
sql
=
"set nocount on insert "
+
TableName
+
" ("
+
cols
+
") values ("
+
cols_params
+
") select cast(scope_identity() as int)"
;
...
...
@@ -75,7 +75,7 @@ public int Update(TId id, dynamic data)
var
builder
=
new
StringBuilder
();
builder
.
Append
(
"update "
).
Append
(
TableName
).
Append
(
" set "
);
builder
.
AppendLine
(
string
.
Join
(
","
,
paramNames
.
Where
(
n
=>
n
!=
"Id"
).
Select
(
p
=>
p
+
"
= @"
+
p
)));
builder
.
AppendLine
(
string
.
Join
(
","
,
paramNames
.
Where
(
n
=>
n
!=
"Id"
).
Select
(
p
=>
"["
+
p
+
"]
= @"
+
p
)));
builder
.
Append
(
"where Id = @Id"
);
DynamicParameters
parameters
=
new
DynamicParameters
(
data
);
...
...
Dapper.Rainbow/SqlCompactDatabase.cs
View file @
f8ce0e45
...
...
@@ -25,7 +25,7 @@ public SqlCompactTable(Database<TDatabase> database, string likelyTableName)
List
<
string
>
paramNames
=
GetParamNames
(
o
);
paramNames
.
Remove
(
"Id"
);
string
cols
=
string
.
Join
(
","
,
paramNames
);
string
cols
=
string
.
Join
(
","
,
paramNames
.
Select
(
p
=>
"["
+
p
+
"]"
)
);
string
cols_params
=
string
.
Join
(
","
,
paramNames
.
Select
(
p
=>
"@"
+
p
));
var
sql
=
"insert "
+
TableName
+
" ("
+
cols
+
") values ("
+
cols_params
+
")"
;
...
...
dapper.nuspec
View file @
f8ce0e45
...
...
@@ -7,7 +7,7 @@
<authors>
Sam Saffron,Marc Gravell
</authors>
<owners>
Sam Saffron,Marc Gravell
</owners>
<licenseUrl>
http://www.apache.org/licenses/LICENSE-2.0
</licenseUrl>
<projectUrl>
http
://code.google.com/p/dapper-dot-net/
</projectUrl>
<projectUrl>
http
s://github.com/StackExchange/dapper-dot-net
</projectUrl>
<requireLicenseAcceptance>
false
</requireLicenseAcceptance>
<description>
A high performance Micro-ORM supporting Sql Server, MySQL, Sqlite, SqlCE, Firebird etc..
</description>
<summary>
A high performance Micro-ORM
</summary>
...
...
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