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
d0b9bf9c
Commit
d0b9bf9c
authored
Apr 03, 2012
by
Sam Saffron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no dapper contrib in dapper tests please
parent
12a79114
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
Tests.cs
Tests/Tests.cs
+3
-7
No files found.
Tests/Tests.cs
View file @
d0b9bf9c
//#define POSTGRESQL
-
uncomment to run postgres tests
//#define POSTGRESQL
//
uncomment to run postgres tests
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Data.SqlClient
;
using
System.Data.SqlClient
;
...
@@ -10,7 +10,6 @@
...
@@ -10,7 +10,6 @@
using
System.Collections
;
using
System.Collections
;
using
System.Reflection
;
using
System.Reflection
;
#if POSTGRESQL
#if POSTGRESQL
using
Dapper.Contrib.Extensions
;
using
Npgsql
;
using
Npgsql
;
#endif
#endif
...
@@ -1395,10 +1394,9 @@ public enum ShortEnum : short
...
@@ -1395,10 +1394,9 @@ public enum ShortEnum : short
}
}
#if POSTGRESQL
#if POSTGRESQL
[
Table
(
"tcat"
)]
class
Cat
class
Cat
{
{
[
Key
]
public
int
Id
{
get
;
set
;
}
public
int
Id
{
get
;
set
;
}
public
string
Breed
{
get
;
set
;
}
public
string
Breed
{
get
;
set
;
}
public
string
Name
{
get
;
set
;
}
public
string
Name
{
get
;
set
;
}
...
@@ -1424,9 +1422,7 @@ public void TestPostresqlArrayParameters()
...
@@ -1424,9 +1422,7 @@ public void TestPostresqlArrayParameters()
conn
.
Open
();
conn
.
Open
();
IDbTransaction
transaction
=
conn
.
BeginTransaction
();
IDbTransaction
transaction
=
conn
.
BeginTransaction
();
conn
.
Execute
(
"create table tcat ( id serial not null, breed character varying(20) not null, name character varying (20) not null);"
);
conn
.
Execute
(
"create table tcat ( id serial not null, breed character varying(20) not null, name character varying (20) not null);"
);
conn
.
Execute
(
"insert tcat(breed, name) values(:breed, :name) "
,
Cats
);
foreach
(
var
cat
in
Cats
)
conn
.
Insert
(
cat
);
var
r
=
conn
.
Query
<
Cat
>(
"select * from tcat where id=any(:catids)"
,
new
{
catids
=
new
[]
{
1
,
3
,
5
}
});
var
r
=
conn
.
Query
<
Cat
>(
"select * from tcat where id=any(:catids)"
,
new
{
catids
=
new
[]
{
1
,
3
,
5
}
});
r
.
Count
().
IsEqualTo
(
3
);
r
.
Count
().
IsEqualTo
(
3
);
...
...
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