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
28c33d45
Commit
28c33d45
authored
Jan 12, 2012
by
Sam Saffron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dapper rainbow is now on nuget
parent
c9160c13
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
9 deletions
+45
-9
Dapper.Rainbow.csproj
Dapper.Rainbow/Dapper.Rainbow.csproj
+3
-0
Dapper.Rainbow.nuspec
Dapper.Rainbow/Dapper.Rainbow.nuspec
+23
-0
Database.cs
Dapper.Rainbow/Database.cs
+9
-4
AssemblyInfo.cs
Dapper.Rainbow/Properties/AssemblyInfo.cs
+4
-4
Snapshotter.cs
Dapper.Rainbow/Snapshotter.cs
+6
-1
No files found.
Dapper.Rainbow/Dapper.Rainbow.csproj
View file @
28c33d45
...
@@ -50,6 +50,9 @@
...
@@ -50,6 +50,9 @@
<Name>
Dapper
</Name>
<Name>
Dapper
</Name>
</ProjectReference>
</ProjectReference>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<None
Include=
"Dapper.Rainbow.nuspec"
/>
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Other similar extension points exist, see Microsoft.Common.targets.
...
...
Dapper.Rainbow/Dapper.Rainbow.nuspec
0 → 100644
View file @
28c33d45
<?xml version="1.0"?>
<package
>
<metadata>
<id>
Dapper.Rainbow
</id>
<version>
0.1
</version>
<title>
Dapper.Rainbow
</title>
<authors>
Sam Saffron
</authors>
<owners>
Sam Saffron
</owners>
<licenseUrl>
http://www.apache.org/licenses/LICENSE-2.0
</licenseUrl>
<projectUrl>
http://code.google.com/p/dapper-dot-net/
</projectUrl>
<requireLicenseAcceptance>
false
</requireLicenseAcceptance>
<description>
Trivial micro-orm implemented on Dapper, provides with CRUD helpers
</description>
<releaseNotes>
* version 0.1
</releaseNotes>
<copyright>
Copyright Sam Saffron 2012
</copyright>
<tags>
orm dapper micro-orm
</tags>
<dependencies>
<dependency
id=
"Dapper"
version=
"1.8"
/>
</dependencies>
</metadata>
<files>
<file
src=
"bin\Release\Dapper.Rainbow.dll"
target=
"lib\net40"
/>
</files>
</package>
\ No newline at end of file
Dapper.Rainbow/Database.cs
View file @
28c33d45
using
System
;
/*
License: http://www.apache.org/licenses/LICENSE-2.0
Home page: http://code.google.com/p/dapper-dot-net/
*/
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Web
;
using
System.Web
;
...
@@ -65,7 +70,7 @@ public string TableName
...
@@ -65,7 +70,7 @@ public string TableName
/// <returns></returns>
/// <returns></returns>
public
int
Update
(
int
id
,
dynamic
data
)
public
int
Update
(
int
id
,
dynamic
data
)
{
{
List
<
string
>
paramNames
=
GetParamNames
(
data
);
List
<
string
>
paramNames
=
GetParamNames
(
(
object
)
data
);
var
builder
=
new
StringBuilder
();
var
builder
=
new
StringBuilder
();
builder
.
Append
(
"update ["
).
Append
(
TableName
).
Append
(
"] set "
);
builder
.
Append
(
"update ["
).
Append
(
TableName
).
Append
(
"] set "
);
...
@@ -135,7 +140,7 @@ private static List<string> GetParamNames(object o)
...
@@ -135,7 +140,7 @@ private static List<string> GetParamNames(object o)
DbTransaction
transaction
;
DbTransaction
transaction
;
public
static
TDatabase
Create
(
DbConnection
connection
,
int
commandTimeout
)
public
static
TDatabase
Init
(
DbConnection
connection
,
int
commandTimeout
)
{
{
TDatabase
db
=
new
TDatabase
();
TDatabase
db
=
new
TDatabase
();
db
.
InitDatabase
(
connection
,
commandTimeout
);
db
.
InitDatabase
(
connection
,
commandTimeout
);
...
@@ -173,7 +178,7 @@ public void RollbackTransaction()
...
@@ -173,7 +178,7 @@ public void RollbackTransaction()
transaction
=
null
;
transaction
=
null
;
}
}
p
ublic
Action
<
Database
<
TDatabase
>>
CreateTableConstructor
()
p
rotected
Action
<
Database
<
TDatabase
>>
CreateTableConstructor
()
{
{
var
dm
=
new
DynamicMethod
(
"ConstructInstances"
,
null
,
new
Type
[]
{
typeof
(
Database
<
TDatabase
>)
},
true
);
var
dm
=
new
DynamicMethod
(
"ConstructInstances"
,
null
,
new
Type
[]
{
typeof
(
Database
<
TDatabase
>)
},
true
);
var
il
=
dm
.
GetILGenerator
();
var
il
=
dm
.
GetILGenerator
();
...
...
Dapper.Rainbow/Properties/AssemblyInfo.cs
View file @
28c33d45
...
@@ -6,11 +6,11 @@
...
@@ -6,11 +6,11 @@
// set of attributes. Change these attribute values to modify the information
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
// associated with an assembly.
[
assembly
:
AssemblyTitle
(
"Dapper.Rainbow"
)]
[
assembly
:
AssemblyTitle
(
"Dapper.Rainbow"
)]
[
assembly
:
AssemblyDescription
(
""
)]
[
assembly
:
AssemblyDescription
(
"
I sample mini ORM implementation using Dapper
"
)]
[
assembly
:
AssemblyConfiguration
(
""
)]
[
assembly
:
AssemblyConfiguration
(
""
)]
[
assembly
:
AssemblyCompany
(
""
)]
[
assembly
:
AssemblyCompany
(
""
)]
[
assembly
:
AssemblyProduct
(
"Dapper.Rainbow"
)]
[
assembly
:
AssemblyProduct
(
"Dapper.Rainbow"
)]
[
assembly
:
AssemblyCopyright
(
"Copyright © 2012"
)]
[
assembly
:
AssemblyCopyright
(
"
Sam Saffron
Copyright © 2012"
)]
[
assembly
:
AssemblyTrademark
(
""
)]
[
assembly
:
AssemblyTrademark
(
""
)]
[
assembly
:
AssemblyCulture
(
""
)]
[
assembly
:
AssemblyCulture
(
""
)]
...
@@ -32,5 +32,5 @@
...
@@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
// [assembly: AssemblyVersion("1.0.*")]
[
assembly
:
AssemblyVersion
(
"
1.0
.0.0"
)]
[
assembly
:
AssemblyVersion
(
"
0.1
.0.0"
)]
[
assembly
:
AssemblyFileVersion
(
"
1.0
.0.0"
)]
[
assembly
:
AssemblyFileVersion
(
"
0.1
.0.0"
)]
Dapper.Rainbow/Snapshotter.cs
View file @
28c33d45
using
System
;
/*
License: http://www.apache.org/licenses/LICENSE-2.0
Home page: http://code.google.com/p/dapper-dot-net/
*/
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Web
;
using
System.Web
;
...
...
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