Commit d0b9bf9c authored by Sam Saffron's avatar Sam Saffron

no dapper contrib in dapper tests please

parent 12a79114
//#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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment