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
8e070ddc
Commit
8e070ddc
authored
May 23, 2016
by
Nick Craver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Interfaces are back, simplifying code.
Related issue: #520
parent
96e07ced
Changes
36
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
11 additions
and
366 deletions
+11
-366
SqlMapperExtensions.Async.cs
Dapper.Contrib/SqlMapperExtensions.Async.cs
+1
-7
SqlMapperExtensions.cs
Dapper.Contrib/SqlMapperExtensions.cs
+0
-2
Database.Async.cs
Dapper.Rainbow/Database.Async.cs
+0
-4
Database.cs
Dapper.Rainbow/Database.cs
+0
-4
TestSuite.cs
Dapper.Tests.Contrib/TestSuite.cs
+1
-4
TestSuites.cs
Dapper.Tests.Contrib/TestSuites.cs
+0
-1
Tests.Async.cs
Dapper.Tests/Tests.Async.cs
+0
-4
Tests.Constructors.cs
Dapper.Tests/Tests.Constructors.cs
+0
-8
Tests.Enums.cs
Dapper.Tests/Tests.Enums.cs
+0
-8
Tests.MultiMap.cs
Dapper.Tests/Tests.MultiMap.cs
+0
-8
Tests.Parameters.cs
Dapper.Tests/Tests.Parameters.cs
+0
-8
Tests.QueryMultiple.cs
Dapper.Tests/Tests.QueryMultiple.cs
+0
-9
Tests.cs
Dapper.Tests/Tests.cs
+0
-63
CommandDefinition.cs
Dapper/CommandDefinition.cs
+0
-6
DbString.cs
Dapper/DbString.cs
+0
-4
DefaultTypeMap.cs
Dapper/DefaultTypeMap.cs
+3
-0
DynamicParameters.ParamInfo.cs
Dapper/DynamicParameters.ParamInfo.cs
+0
-3
DynamicParameters.cs
Dapper/DynamicParameters.cs
+0
-2
FeatureSupport.cs
Dapper/FeatureSupport.cs
+0
-3
SqlMapper.Async.cs
Dapper/SqlMapper.Async.cs
+0
-7
SqlMapper.CacheInfo.cs
Dapper/SqlMapper.CacheInfo.cs
+0
-5
SqlMapper.DeserializerState.cs
Dapper/SqlMapper.DeserializerState.cs
+0
-4
SqlMapper.GridReader.Async.cs
Dapper/SqlMapper.GridReader.Async.cs
+1
-4
SqlMapper.GridReader.cs
Dapper/SqlMapper.GridReader.cs
+0
-5
SqlMapper.ICustomQueryParameter.cs
Dapper/SqlMapper.ICustomQueryParameter.cs
+0
-3
SqlMapper.IDataReader.cs
Dapper/SqlMapper.IDataReader.cs
+0
-4
SqlMapper.IDynamicParameters.cs
Dapper/SqlMapper.IDynamicParameters.cs
+0
-4
SqlMapper.ITypeHandler.cs
Dapper/SqlMapper.ITypeHandler.cs
+0
-3
SqlMapper.Identity.cs
Dapper/SqlMapper.Identity.cs
+0
-4
SqlMapper.TypeDeserializerCache.cs
Dapper/SqlMapper.TypeDeserializerCache.cs
+1
-5
SqlMapper.TypeHandler.cs
Dapper/SqlMapper.TypeHandler.cs
+0
-4
SqlMapper.TypeHandlerCache.cs
Dapper/SqlMapper.TypeHandlerCache.cs
+0
-4
SqlMapper.cs
Dapper/SqlMapper.cs
+4
-12
WrappedDataReader.cs
Dapper/WrappedDataReader.cs
+0
-23
WrappedReader.cs
Dapper/WrappedReader.cs
+0
-124
XmlHandlers.cs
Dapper/XmlHandlers.cs
+0
-3
No files found.
Dapper.Contrib/SqlMapperExtensions.Async.cs
View file @
8e070ddc
#
if
ASYNC
#
if
ASYNC
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Data
;
using
System.Linq
;
using
System.Linq
;
using
System.Reflection
;
using
System.Reflection
;
using
System.Text
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Dapper
;
using
Dapper
;
#if COREFX
using
IDbTransaction
=
System
.
Data
.
Common
.
DbTransaction
;
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
using
DataException
=
System
.
InvalidOperationException
;
#else
using
System.Data
;
#endif
namespace
Dapper.Contrib.Extensions
namespace
Dapper.Contrib.Extensions
{
{
...
...
Dapper.Contrib/SqlMapperExtensions.cs
View file @
8e070ddc
...
@@ -10,8 +10,6 @@
...
@@ -10,8 +10,6 @@
using
Dapper
;
using
Dapper
;
#if COREFX
#if COREFX
using
IDbTransaction
=
System
.
Data
.
Common
.
DbTransaction
;
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
using
DataException
=
System
.
InvalidOperationException
;
using
DataException
=
System
.
InvalidOperationException
;
#else
#else
using
System.Threading
;
using
System.Threading
;
...
...
Dapper.Rainbow/Database.Async.cs
View file @
8e070ddc
...
@@ -6,10 +6,6 @@
...
@@ -6,10 +6,6 @@
using
System.Text
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
#if COREFX
using
IDbTransaction
=
System
.
Data
.
Common
.
DbTransaction
;
#endif
namespace
Dapper
namespace
Dapper
{
{
public
abstract
partial
class
Database
<
TDatabase
>
where
TDatabase
:
Database
<
TDatabase
>,
new
()
public
abstract
partial
class
Database
<
TDatabase
>
where
TDatabase
:
Database
<
TDatabase
>,
new
()
...
...
Dapper.Rainbow/Database.cs
View file @
8e070ddc
...
@@ -8,10 +8,6 @@
...
@@ -8,10 +8,6 @@
using
System.Data.Common
;
using
System.Data.Common
;
using
System.Reflection.Emit
;
using
System.Reflection.Emit
;
#if COREFX
using
IDbTransaction
=
System
.
Data
.
Common
.
DbTransaction
;
#endif
namespace
Dapper
namespace
Dapper
{
{
/// <summary>
/// <summary>
...
...
Dapper.Tests.Contrib/TestSuite.cs
View file @
8e070ddc
...
@@ -5,10 +5,7 @@
...
@@ -5,10 +5,7 @@
using
Dapper.Contrib.Extensions
;
using
Dapper.Contrib.Extensions
;
#if COREFX
#if !COREFX
using
System.Reflection
;
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
#else
using
System.Data.SqlServerCe
;
using
System.Data.SqlServerCe
;
using
System.Transactions
;
using
System.Transactions
;
#endif
#endif
...
...
Dapper.Tests.Contrib/TestSuites.cs
View file @
8e070ddc
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
using
Xunit.Sdk
;
using
Xunit.Sdk
;
#if COREFX
#if COREFX
using
Microsoft.Data.Sqlite
;
using
Microsoft.Data.Sqlite
;
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
#else
#else
using
System.Data.SQLite
;
using
System.Data.SQLite
;
using
System.Data.SqlServerCe
;
using
System.Data.SqlServerCe
;
...
...
Dapper.Tests/Tests.Async.cs
View file @
8e070ddc
...
@@ -8,10 +8,6 @@
...
@@ -8,10 +8,6 @@
using
System.Data.SqlClient
;
using
System.Data.SqlClient
;
using
Xunit
;
using
Xunit
;
#if COREFX
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
#endif
namespace
Dapper.Tests
namespace
Dapper.Tests
{
{
public
partial
class
TestSuite
public
partial
class
TestSuite
...
...
Dapper.Tests/Tests.Constructors.cs
View file @
8e070ddc
...
@@ -4,14 +4,6 @@
...
@@ -4,14 +4,6 @@
using
System.Linq
;
using
System.Linq
;
using
Xunit
;
using
Xunit
;
#if COREFX
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
using
IDbTransaction
=
System
.
Data
.
Common
.
DbTransaction
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
namespace
Dapper.Tests
namespace
Dapper.Tests
{
{
public
partial
class
TestSuite
public
partial
class
TestSuite
...
...
Dapper.Tests/Tests.Enums.cs
View file @
8e070ddc
...
@@ -4,14 +4,6 @@
...
@@ -4,14 +4,6 @@
using
System.Linq
;
using
System.Linq
;
using
Xunit
;
using
Xunit
;
#if COREFX
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
using
IDbTransaction
=
System
.
Data
.
Common
.
DbTransaction
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
namespace
Dapper.Tests
namespace
Dapper.Tests
{
{
public
partial
class
TestSuite
public
partial
class
TestSuite
...
...
Dapper.Tests/Tests.MultiMap.cs
View file @
8e070ddc
...
@@ -5,14 +5,6 @@
...
@@ -5,14 +5,6 @@
using
System.Linq
;
using
System.Linq
;
using
Xunit
;
using
Xunit
;
#if COREFX
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
using
IDbTransaction
=
System
.
Data
.
Common
.
DbTransaction
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
namespace
Dapper.Tests
namespace
Dapper.Tests
{
{
public
partial
class
TestSuite
public
partial
class
TestSuite
...
...
Dapper.Tests/Tests.Parameters.cs
View file @
8e070ddc
...
@@ -14,14 +14,6 @@
...
@@ -14,14 +14,6 @@
using
Microsoft.SqlServer.Types
;
using
Microsoft.SqlServer.Types
;
#endif
#endif
#if COREFX
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
using
IDbTransaction
=
System
.
Data
.
Common
.
DbTransaction
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
namespace
Dapper.Tests
namespace
Dapper.Tests
{
{
public
partial
class
TestSuite
public
partial
class
TestSuite
...
...
Dapper.Tests/Tests.QueryMultiple.cs
View file @
8e070ddc
...
@@ -4,14 +4,6 @@
...
@@ -4,14 +4,6 @@
using
System.Linq
;
using
System.Linq
;
using
Xunit
;
using
Xunit
;
#if COREFX
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
using
IDbTransaction
=
System
.
Data
.
Common
.
DbTransaction
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
namespace
Dapper.Tests
namespace
Dapper.Tests
{
{
public
partial
class
TestSuite
public
partial
class
TestSuite
...
@@ -48,7 +40,6 @@ public void TestQueryMultipleNonBufferedIncorrectOrder()
...
@@ -48,7 +40,6 @@ public void TestQueryMultipleNonBufferedIncorrectOrder()
{
{
// that's expected
// that's expected
}
}
}
}
}
}
...
...
Dapper.Tests/Tests.cs
View file @
8e070ddc
//#define POSTGRESQL // uncomment to run postgres tests
//#define POSTGRESQL // uncomment to run postgres tests
#if COREFX
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
using
IDbTransaction
=
System
.
Data
.
Common
.
DbTransaction
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
#if SQLITE && (NET40 || NET45)
#if SQLITE && (NET40 || NET45)
using
SqliteConnection
=
System
.
Data
.
SQLite
.
SQLiteConnection
;
using
SqliteConnection
=
System
.
Data
.
SQLite
.
SQLiteConnection
;
#endif
#endif
...
@@ -1847,60 +1839,6 @@ public void TestChangingDefaultStringTypeMappingToAnsiStringFirstOrDefault()
...
@@ -1847,60 +1839,6 @@ public void TestChangingDefaultStringTypeMappingToAnsiStringFirstOrDefault()
Dapper
.
SqlMapper
.
AddTypeMap
(
typeof
(
string
),
DbType
.
String
);
// Restore Default to Unicode String
Dapper
.
SqlMapper
.
AddTypeMap
(
typeof
(
string
),
DbType
.
String
);
// Restore Default to Unicode String
}
}
#if COREFX
class
TransactedConnection
:
IDbConnection
{
IDbConnection
_conn
;
IDbTransaction
_tran
;
public
TransactedConnection
(
IDbConnection
conn
,
IDbTransaction
tran
)
{
_conn
=
conn
;
_tran
=
tran
;
}
public
override
string
ConnectionString
{
get
{
return
_conn
.
ConnectionString
;
}
set
{
_conn
.
ConnectionString
=
value
;
}
}
public
override
int
ConnectionTimeout
=>
_conn
.
ConnectionTimeout
;
public
override
string
Database
=>
_conn
.
Database
;
public
override
ConnectionState
State
=>
_conn
.
State
;
protected
override
IDbTransaction
BeginDbTransaction
(
IsolationLevel
isolationLevel
)
{
return
_tran
;
}
public
override
void
ChangeDatabase
(
string
databaseName
)
{
_conn
.
ChangeDatabase
(
databaseName
);
}
public
override
string
DataSource
=>
_conn
.
DataSource
;
public
override
string
ServerVersion
=>
_conn
.
ServerVersion
;
public
override
void
Close
()
{
_conn
.
Close
();
}
protected
override
IDbCommand
CreateDbCommand
()
{
// The command inherits the "current" transaction.
var
command
=
_conn
.
CreateCommand
();
command
.
Transaction
=
_tran
;
return
command
;
}
protected
override
void
Dispose
(
bool
disposing
)
{
if
(
disposing
)
_conn
.
Dispose
();
base
.
Dispose
(
disposing
);
}
public
override
void
Open
()
{
_conn
.
Open
();
}
}
#else
class
TransactedConnection
:
IDbConnection
class
TransactedConnection
:
IDbConnection
{
{
IDbConnection
_conn
;
IDbConnection
_conn
;
...
@@ -1955,7 +1893,6 @@ public void Open()
...
@@ -1955,7 +1893,6 @@ public void Open()
_conn
.
Open
();
_conn
.
Open
();
}
}
}
}
#endif
[
Fact
]
[
Fact
]
public
void
TestDapperTableMetadataRetrieval
()
public
void
TestDapperTableMetadataRetrieval
()
...
...
Dapper/CommandDefinition.cs
View file @
8e070ddc
...
@@ -4,12 +4,6 @@
...
@@ -4,12 +4,6 @@
using
System.Reflection.Emit
;
using
System.Reflection.Emit
;
using
System.Threading
;
using
System.Threading
;
#if COREFX
using
IDbTransaction
=
System
.
Data
.
Common
.
DbTransaction
;
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
#endif
namespace
Dapper
namespace
Dapper
{
{
/// <summary>
/// <summary>
...
...
Dapper/DbString.cs
View file @
8e070ddc
using
System
;
using
System
;
using
System.Data
;
using
System.Data
;
#if COREFX
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
#endif
namespace
Dapper
namespace
Dapper
{
{
/// <summary>
/// <summary>
...
...
Dapper/DefaultTypeMap.cs
View file @
8e070ddc
...
@@ -195,6 +195,9 @@ public SqlMapper.IMemberMap GetMember(string columnName)
...
@@ -195,6 +195,9 @@ public SqlMapper.IMemberMap GetMember(string columnName)
/// </summary>
/// </summary>
public
static
bool
MatchNamesWithUnderscores
{
get
;
set
;
}
public
static
bool
MatchNamesWithUnderscores
{
get
;
set
;
}
/// <summary>
/// The settable properties for this typemap
/// </summary>
public
List
<
PropertyInfo
>
Properties
{
get
;
}
public
List
<
PropertyInfo
>
Properties
{
get
;
}
}
}
}
}
Dapper/DynamicParameters.ParamInfo.cs
View file @
8e070ddc
using
System
;
using
System
;
using
System.Data
;
using
System.Data
;
#if COREFX
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
#endif
namespace
Dapper
namespace
Dapper
{
{
partial
class
DynamicParameters
partial
class
DynamicParameters
...
...
Dapper/DynamicParameters.cs
View file @
8e070ddc
...
@@ -7,8 +7,6 @@
...
@@ -7,8 +7,6 @@
using
System.Reflection.Emit
;
using
System.Reflection.Emit
;
#if COREFX
#if COREFX
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
ApplicationException
=
System
.
InvalidOperationException
;
using
ApplicationException
=
System
.
InvalidOperationException
;
#endif
#endif
...
...
Dapper/FeatureSupport.cs
View file @
8e070ddc
using
System
;
using
System
;
using
System.Data
;
using
System.Data
;
#if COREFX
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
#endif
namespace
Dapper
namespace
Dapper
{
{
/// <summary>
/// <summary>
...
...
Dapper/SqlMapper.Async.cs
View file @
8e070ddc
...
@@ -9,13 +9,6 @@
...
@@ -9,13 +9,6 @@
using
System.Threading
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
#if COREFX
using
IDbTransaction
=
System
.
Data
.
Common
.
DbTransaction
;
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
namespace
Dapper
namespace
Dapper
{
{
public
static
partial
class
SqlMapper
public
static
partial
class
SqlMapper
...
...
Dapper/SqlMapper.CacheInfo.cs
View file @
8e070ddc
...
@@ -2,11 +2,6 @@
...
@@ -2,11 +2,6 @@
using
System.Data
;
using
System.Data
;
using
System.Threading
;
using
System.Threading
;
#if COREFX
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
namespace
Dapper
namespace
Dapper
{
{
partial
class
SqlMapper
partial
class
SqlMapper
...
...
Dapper/SqlMapper.DeserializerState.cs
View file @
8e070ddc
using
System
;
using
System
;
using
System.Data
;
using
System.Data
;
#if COREFX
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
namespace
Dapper
namespace
Dapper
{
{
partial
class
SqlMapper
partial
class
SqlMapper
...
...
Dapper/SqlMapper.GridReader.Async.cs
View file @
8e070ddc
...
@@ -6,10 +6,7 @@
...
@@ -6,10 +6,7 @@
using
System.Linq
;
using
System.Linq
;
using
System.Threading
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
#if COREFX
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
namespace
Dapper
namespace
Dapper
{
{
partial
class
SqlMapper
partial
class
SqlMapper
...
...
Dapper/SqlMapper.GridReader.cs
View file @
8e070ddc
...
@@ -3,11 +3,6 @@
...
@@ -3,11 +3,6 @@
using
System.Data
;
using
System.Data
;
using
System.Linq
;
using
System.Linq
;
#if COREFX
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
namespace
Dapper
namespace
Dapper
{
{
partial
class
SqlMapper
partial
class
SqlMapper
...
...
Dapper/SqlMapper.ICustomQueryParameter.cs
View file @
8e070ddc
using
System.Data
;
using
System.Data
;
#if COREFX
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
#endif
namespace
Dapper
namespace
Dapper
{
{
partial
class
SqlMapper
partial
class
SqlMapper
...
...
Dapper/SqlMapper.IDataReader.cs
View file @
8e070ddc
...
@@ -2,10 +2,6 @@
...
@@ -2,10 +2,6 @@
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Data
;
using
System.Data
;
#if COREFX
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
namespace
Dapper
namespace
Dapper
{
{
partial
class
SqlMapper
partial
class
SqlMapper
...
...
Dapper/SqlMapper.IDynamicParameters.cs
View file @
8e070ddc
using
System.Data
;
using
System.Data
;
#if COREFX
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
#endif
namespace
Dapper
namespace
Dapper
{
{
partial
class
SqlMapper
partial
class
SqlMapper
...
...
Dapper/SqlMapper.ITypeHandler.cs
View file @
8e070ddc
using
System
;
using
System
;
using
System.Data
;
using
System.Data
;
#if COREFX
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
#endif
namespace
Dapper
namespace
Dapper
{
{
partial
class
SqlMapper
partial
class
SqlMapper
...
...
Dapper/SqlMapper.Identity.cs
View file @
8e070ddc
using
System
;
using
System
;
using
System.Data
;
using
System.Data
;
#if COREFX
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
#endif
namespace
Dapper
namespace
Dapper
{
{
partial
class
SqlMapper
partial
class
SqlMapper
...
...
Dapper/SqlMapper.TypeDeserializerCache.cs
View file @
8e070ddc
#
if
COREFX
using
System
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
using
System
;
using
System.Data
;
using
System.Data
;
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
...
Dapper/SqlMapper.TypeHandler.cs
View file @
8e070ddc
using
System
;
using
System
;
using
System.Data
;
using
System.Data
;
#if COREFX
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
#endif
namespace
Dapper
namespace
Dapper
{
{
partial
class
SqlMapper
partial
class
SqlMapper
...
...
Dapper/SqlMapper.TypeHandlerCache.cs
View file @
8e070ddc
...
@@ -2,10 +2,6 @@
...
@@ -2,10 +2,6 @@
using
System.ComponentModel
;
using
System.ComponentModel
;
using
System.Data
;
using
System.Data
;
#if COREFX
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
#endif
namespace
Dapper
namespace
Dapper
{
{
partial
class
SqlMapper
partial
class
SqlMapper
...
...
Dapper/SqlMapper.cs
View file @
8e070ddc
...
@@ -3,18 +3,6 @@
...
@@ -3,18 +3,6 @@
Home page: https://github.com/StackExchange/dapper-dot-net
Home page: https://github.com/StackExchange/dapper-dot-net
*/
*/
#if COREFX
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
using
IDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
using
IDbTransaction
=
System
.
Data
.
Common
.
DbTransaction
;
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
using
IDataRecord
=
System
.
Data
.
Common
.
DbDataReader
;
using
IDataParameterCollection
=
System
.
Data
.
Common
.
DbParameterCollection
;
using
DataException
=
System
.
InvalidOperationException
;
#endif
using
System
;
using
System
;
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -31,6 +19,10 @@
...
@@ -31,6 +19,10 @@
using
System.Xml
;
using
System.Xml
;
using
System.Xml.Linq
;
using
System.Xml.Linq
;
#if COREFX
using
DataException
=
System
.
InvalidOperationException
;
#endif
namespace
Dapper
namespace
Dapper
{
{
...
...
Dapper/WrappedDataReader.cs
View file @
8e070ddc
using
System.Data
;
using
System.Data
;
#if COREFX
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
namespace
Dapper
namespace
Dapper
{
{
#if COREFX
/// <summary>
/// Describes a reader that controls the lifetime of both a command and a reader,
/// exposing the downstream command/reader as properties.
/// </summary>
public
abstract
class
WrappedDataReader
:
IDataReader
{
/// <summary>
/// Obtain the underlying reader
/// </summary>
public
abstract
IDataReader
Reader
{
get
;
}
/// <summary>
/// Obtain the underlying command
/// </summary>
public
abstract
IDbCommand
Command
{
get
;
}
}
#else
/// <summary>
/// <summary>
/// Describes a reader that controls the lifetime of both a command and a reader,
/// Describes a reader that controls the lifetime of both a command and a reader,
/// exposing the downstream command/reader as properties.
/// exposing the downstream command/reader as properties.
...
@@ -39,5 +17,4 @@ public interface IWrappedDataReader : IDataReader
...
@@ -39,5 +17,4 @@ public interface IWrappedDataReader : IDataReader
/// </summary>
/// </summary>
IDbCommand
Command
{
get
;
}
IDbCommand
Command
{
get
;
}
}
}
#endif
}
}
Dapper/WrappedReader.cs
View file @
8e070ddc
using
System
;
using
System
;
using
System.Data
;
using
System.Data
;
using
System.Collections
;
#if COREFX
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
namespace
Dapper
namespace
Dapper
{
{
#if COREFX
internal
class
WrappedReader
:
WrappedDataReader
{
private
IDbCommand
cmd
;
private
IDataReader
reader
;
public
override
IEnumerator
GetEnumerator
()
{
return
Reader
.
GetEnumerator
();
}
public
WrappedReader
(
IDbCommand
cmd
,
IDataReader
reader
)
{
this
.
cmd
=
cmd
;
this
.
reader
=
reader
;
}
public
override
IDataReader
Reader
{
get
{
var
tmp
=
reader
;
if
(
tmp
==
null
)
throw
new
ObjectDisposedException
(
this
.
GetType
().
Name
);
return
tmp
;
}
}
public
override
IDbCommand
Command
{
get
{
var
tmp
=
cmd
;
if
(
tmp
==
null
)
throw
new
ObjectDisposedException
(
this
.
GetType
().
Name
);
return
tmp
;
}
}
public
override
int
Depth
=>
Reader
.
Depth
;
public
override
bool
IsClosed
=>
reader
?.
IsClosed
??
true
;
public
override
bool
HasRows
=>
Reader
.
HasRows
;
public
override
bool
NextResult
()
=>
Reader
.
NextResult
();
public
override
bool
Read
()
=>
Reader
.
Read
();
public
override
int
RecordsAffected
=>
Reader
.
RecordsAffected
;
protected
override
void
Dispose
(
bool
disposing
)
{
if
(
disposing
)
{
reader
?.
Dispose
();
reader
=
null
;
cmd
?.
Dispose
();
cmd
=
null
;
}
base
.
Dispose
(
disposing
);
}
public
override
int
FieldCount
=>
Reader
.
FieldCount
;
public
override
bool
GetBoolean
(
int
i
)
=>
Reader
.
GetBoolean
(
i
);
public
override
byte
GetByte
(
int
i
)
=>
Reader
.
GetByte
(
i
);
public
override
long
GetBytes
(
int
i
,
long
fieldOffset
,
byte
[]
buffer
,
int
bufferoffset
,
int
length
)
{
return
Reader
.
GetBytes
(
i
,
fieldOffset
,
buffer
,
bufferoffset
,
length
);
}
public
override
char
GetChar
(
int
i
)
=>
Reader
.
GetChar
(
i
);
public
override
long
GetChars
(
int
i
,
long
fieldoffset
,
char
[]
buffer
,
int
bufferoffset
,
int
length
)
{
return
Reader
.
GetChars
(
i
,
fieldoffset
,
buffer
,
bufferoffset
,
length
);
}
protected
override
IDataReader
GetDbDataReader
(
int
ordinal
)
=>
Reader
.
GetData
(
ordinal
);
public
override
string
GetDataTypeName
(
int
i
)
=>
Reader
.
GetDataTypeName
(
i
);
public
override
DateTime
GetDateTime
(
int
i
)
=>
Reader
.
GetDateTime
(
i
);
public
override
decimal
GetDecimal
(
int
i
)
=>
Reader
.
GetDecimal
(
i
);
public
override
double
GetDouble
(
int
i
)
=>
Reader
.
GetDouble
(
i
);
public
override
Type
GetFieldType
(
int
i
)
=>
Reader
.
GetFieldType
(
i
);
public
override
float
GetFloat
(
int
i
)
=>
Reader
.
GetFloat
(
i
);
public
override
Guid
GetGuid
(
int
i
)
=>
Reader
.
GetGuid
(
i
);
public
override
short
GetInt16
(
int
i
)
=>
Reader
.
GetInt16
(
i
);
public
override
int
GetInt32
(
int
i
)
=>
Reader
.
GetInt32
(
i
);
public
override
long
GetInt64
(
int
i
)
=>
Reader
.
GetInt64
(
i
);
public
override
string
GetName
(
int
i
)
=>
Reader
.
GetName
(
i
);
public
override
int
GetOrdinal
(
string
name
)
=>
Reader
.
GetOrdinal
(
name
);
public
override
string
GetString
(
int
i
)
=>
Reader
.
GetString
(
i
);
public
override
object
GetValue
(
int
i
)
=>
Reader
.
GetValue
(
i
);
public
override
int
GetValues
(
object
[]
values
)
=>
Reader
.
GetValues
(
values
);
public
override
bool
IsDBNull
(
int
i
)
=>
Reader
.
IsDBNull
(
i
);
public
override
object
this
[
string
name
]
=>
Reader
[
name
];
public
override
object
this
[
int
i
]
=>
Reader
[
i
];
}
#else
internal
class
WrappedReader
:
IDataReader
,
IWrappedDataReader
internal
class
WrappedReader
:
IDataReader
,
IWrappedDataReader
{
{
private
IDataReader
reader
;
private
IDataReader
reader
;
...
@@ -306,5 +183,4 @@ bool IDataRecord.IsDBNull(int i)
...
@@ -306,5 +183,4 @@ bool IDataRecord.IsDBNull(int i)
object
IDataRecord
.
this
[
int
i
]
=>
Reader
[
i
];
object
IDataRecord
.
this
[
int
i
]
=>
Reader
[
i
];
}
}
#endif
}
}
Dapper/XmlHandlers.cs
View file @
8e070ddc
using
System.Data
;
using
System.Data
;
using
System.Xml
;
using
System.Xml
;
using
System.Xml.Linq
;
using
System.Xml.Linq
;
#if COREFX
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
#endif
namespace
Dapper
namespace
Dapper
{
{
...
...
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