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
7b34be3a
Commit
7b34be3a
authored
Aug 21, 2017
by
Nick Craver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net40 is dead - remove #if ASYNC bits
parent
6ce36492
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
8 additions
and
43 deletions
+8
-43
SqlMapperExtensions.Async.cs
Dapper.Contrib/SqlMapperExtensions.Async.cs
+1
-3
Database.Async.cs
Dapper.Rainbow/Database.Async.cs
+1
-3
EntityFrameworkTests.cs
Dapper.Tests/Providers/EntityFrameworkTests.cs
+1
-3
CommandDefinition.cs
Dapper/CommandDefinition.cs
+1
-20
SqlMapper.Async.cs
Dapper/SqlMapper.Async.cs
+1
-3
SqlMapper.GridReader.Async.cs
Dapper/SqlMapper.GridReader.Async.cs
+1
-3
SqlMapper.cs
Dapper/SqlMapper.cs
+2
-4
Directory.build.props
Directory.build.props
+0
-4
No files found.
Dapper.Contrib/SqlMapperExtensions.Async.cs
View file @
7b34be3a
#
if
ASYNC
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Data
;
using
System.Data
;
using
System.Linq
;
using
System.Linq
;
...
@@ -532,4 +531,3 @@ public async Task<int> InsertAsync(IDbConnection connection, IDbTransaction tran
...
@@ -532,4 +531,3 @@ public async Task<int> InsertAsync(IDbConnection connection, IDbTransaction tran
return
Convert
.
ToInt32
(
id
);
return
Convert
.
ToInt32
(
id
);
}
}
}
}
#endif
Dapper.Rainbow/Database.Async.cs
View file @
7b34be3a
#
if
ASYNC
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Data
;
using
System.Data
;
using
System.Linq
;
using
System.Linq
;
...
@@ -210,4 +209,3 @@ public Task<int> UpdateAsync(TId id, dynamic data)
...
@@ -210,4 +209,3 @@ public Task<int> UpdateAsync(TId id, dynamic data)
SqlMapper
.
QueryMultipleAsync
(
_connection
,
sql
,
param
,
transaction
,
commandTimeout
,
commandType
);
SqlMapper
.
QueryMultipleAsync
(
_connection
,
sql
,
param
,
transaction
,
commandTimeout
,
commandType
);
}
}
}
}
#
endif
\ No newline at end of file
Dapper.Tests/Providers/EntityFrameworkTests.cs
View file @
7b34be3a
...
@@ -11,8 +11,7 @@ public EntityFrameworkTests()
...
@@ -11,8 +11,7 @@ public EntityFrameworkTests()
{
{
EntityFramework
.
Handlers
.
Register
();
EntityFramework
.
Handlers
.
Register
();
}
}
#if ASYNC // TODO: Temp workaround in tests
[
Fact
]
[
Fact
]
public
void
Issue570_DbGeo_HasValues
()
public
void
Issue570_DbGeo_HasValues
()
{
{
...
@@ -27,7 +26,6 @@ public void Issue570_DbGeo_HasValues()
...
@@ -27,7 +26,6 @@ public void Issue570_DbGeo_HasValues()
Assert
.
NotNull
(
fromDb
.
Area
);
Assert
.
NotNull
(
fromDb
.
Area
);
Assert
.
Equal
(
orig
.
Area
,
fromDb
.
Area
);
Assert
.
Equal
(
orig
.
Area
,
fromDb
.
Area
);
}
}
#endif
[
Fact
]
[
Fact
]
public
void
Issue22_ExecuteScalar_EntityFramework
()
public
void
Issue22_ExecuteScalar_EntityFramework
()
...
...
Dapper/CommandDefinition.cs
View file @
7b34be3a
...
@@ -73,7 +73,6 @@ internal void OnCompleted()
...
@@ -73,7 +73,6 @@ internal void OnCompleted()
/// </summary>
/// </summary>
public
bool
Pipelined
=>
(
Flags
&
CommandFlags
.
Pipelined
)
!=
0
;
public
bool
Pipelined
=>
(
Flags
&
CommandFlags
.
Pipelined
)
!=
0
;
#if ASYNC
/// <summary>
/// <summary>
/// Initialize the command definition
/// Initialize the command definition
/// </summary>
/// </summary>
...
@@ -84,22 +83,9 @@ internal void OnCompleted()
...
@@ -84,22 +83,9 @@ internal void OnCompleted()
/// <param name="commandType">The <see cref="CommandType"/> for this command.</param>
/// <param name="commandType">The <see cref="CommandType"/> for this command.</param>
/// <param name="flags">The behavior flags for this command.</param>
/// <param name="flags">The behavior flags for this command.</param>
/// <param name="cancellationToken">The cancellation token for this command.</param>
/// <param name="cancellationToken">The cancellation token for this command.</param>
#else
/// <summary>
/// Initialize the command definition
/// </summary>
/// <param name="commandText">The text for this command.</param>
/// <param name="parameters">The parameters for this command.</param>
/// <param name="transaction">The transaction for this command to participate in.</param>
/// <param name="commandTimeout">The timeout (in seconds) for this command.</param>
/// <param name="commandType">The <see cref="CommandType"/> for this command.</param>
/// <param name="flags">The behavior flags for this command.</param>
#endif
public
CommandDefinition
(
string
commandText
,
object
parameters
=
null
,
IDbTransaction
transaction
=
null
,
int
?
commandTimeout
=
null
,
public
CommandDefinition
(
string
commandText
,
object
parameters
=
null
,
IDbTransaction
transaction
=
null
,
int
?
commandTimeout
=
null
,
CommandType
?
commandType
=
null
,
CommandFlags
flags
=
CommandFlags
.
Buffered
CommandType
?
commandType
=
null
,
CommandFlags
flags
=
CommandFlags
.
Buffered
#if ASYNC
,
CancellationToken
cancellationToken
=
default
(
CancellationToken
)
,
CancellationToken
cancellationToken
=
default
(
CancellationToken
)
#endif
)
)
{
{
CommandText
=
commandText
;
CommandText
=
commandText
;
...
@@ -108,9 +94,7 @@ internal void OnCompleted()
...
@@ -108,9 +94,7 @@ internal void OnCompleted()
CommandTimeout
=
commandTimeout
;
CommandTimeout
=
commandTimeout
;
CommandType
=
commandType
;
CommandType
=
commandType
;
Flags
=
flags
;
Flags
=
flags
;
#if ASYNC
CancellationToken
=
cancellationToken
;
CancellationToken
=
cancellationToken
;
#endif
}
}
private
CommandDefinition
(
object
parameters
)
:
this
()
private
CommandDefinition
(
object
parameters
)
:
this
()
...
@@ -118,13 +102,10 @@ private CommandDefinition(object parameters) : this()
...
@@ -118,13 +102,10 @@ private CommandDefinition(object parameters) : this()
Parameters
=
parameters
;
Parameters
=
parameters
;
}
}
#if ASYNC
/// <summary>
/// <summary>
/// For asynchronous operations, the cancellation-token
/// For asynchronous operations, the cancellation-token
/// </summary>
/// </summary>
public
CancellationToken
CancellationToken
{
get
;
}
public
CancellationToken
CancellationToken
{
get
;
}
#endif
internal
IDbCommand
SetupCommand
(
IDbConnection
cnn
,
Action
<
IDbCommand
,
object
>
paramReader
)
internal
IDbCommand
SetupCommand
(
IDbConnection
cnn
,
Action
<
IDbCommand
,
object
>
paramReader
)
{
{
...
@@ -201,4 +182,4 @@ private static MethodInfo GetBasicPropertySetter(Type declaringType, string name
...
@@ -201,4 +182,4 @@ private static MethodInfo GetBasicPropertySetter(Type declaringType, string name
return
null
;
return
null
;
}
}
}
}
}
}
\ No newline at end of file
Dapper/SqlMapper.Async.cs
View file @
7b34be3a
#
if
ASYNC
using
System
;
using
System
;
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Data
;
using
System.Data
;
...
@@ -1190,4 +1189,3 @@ private static async Task<T> ExecuteScalarImplAsync<T>(IDbConnection cnn, Comman
...
@@ -1190,4 +1189,3 @@ private static async Task<T> ExecuteScalarImplAsync<T>(IDbConnection cnn, Comman
}
}
}
}
}
}
#
endif
\ No newline at end of file
Dapper/SqlMapper.GridReader.Async.cs
View file @
7b34be3a
#
if
ASYNC
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Data
;
using
System.Data
;
using
System.Data.Common
;
using
System.Data.Common
;
...
@@ -246,4 +245,3 @@ private async Task<IEnumerable<T>> ReadBufferedAsync<T>(int index, Func<IDataRea
...
@@ -246,4 +245,3 @@ private async Task<IEnumerable<T>> ReadBufferedAsync<T>(int index, Func<IDataRea
}
}
}
}
}
}
#
endif
\ No newline at end of file
Dapper/SqlMapper.cs
View file @
7b34be3a
/*
/*
License: http://www.apache.org/licenses/LICENSE-2.0
License: http://www.apache.org/licenses/LICENSE-2.0
Home page: https://github.com/StackExchange/dapper-dot-net
Home page: https://github.com/StackExchange/dapper-dot-net
*/
*/
...
@@ -516,13 +516,11 @@ private static int ExecuteImpl(this IDbConnection cnn, ref CommandDefinition com
...
@@ -516,13 +516,11 @@ private static int ExecuteImpl(this IDbConnection cnn, ref CommandDefinition com
CacheInfo
info
=
null
;
CacheInfo
info
=
null
;
if
(
multiExec
!=
null
)
if
(
multiExec
!=
null
)
{
{
#if ASYNC
if
((
command
.
Flags
&
CommandFlags
.
Pipelined
)
!=
0
)
if
((
command
.
Flags
&
CommandFlags
.
Pipelined
)
!=
0
)
{
{
// this includes all the code for concurrent/overlapped query
// this includes all the code for concurrent/overlapped query
return
ExecuteMultiImplAsync
(
cnn
,
command
,
multiExec
).
Result
;
return
ExecuteMultiImplAsync
(
cnn
,
command
,
multiExec
).
Result
;
}
}
#endif
bool
isFirst
=
true
;
bool
isFirst
=
true
;
int
total
=
0
;
int
total
=
0
;
bool
wasClosed
=
cnn
.
State
==
ConnectionState
.
Closed
;
bool
wasClosed
=
cnn
.
State
==
ConnectionState
.
Closed
;
...
@@ -3693,4 +3691,4 @@ private static string __ToStringRecycle(this StringBuilder obj)
...
@@ -3693,4 +3691,4 @@ private static string __ToStringRecycle(this StringBuilder obj)
return
s
;
return
s
;
}
}
}
}
}
}
\ No newline at end of file
Directory.build.props
View file @
7b34be3a
...
@@ -26,10 +26,6 @@
...
@@ -26,10 +26,6 @@
<Reference Include="System.Core" Pack="false" />
<Reference Include="System.Core" Pack="false" />
</ItemGroup>
</ItemGroup>
<PropertyGroup Condition=" '$(TargetFramework)' != 'net40'">
<DefineConstants>$(DefineConstants);ASYNC</DefineConstants>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<PackageReference Include="SourceLink.Create.GitHub" Version="2.1.2" PrivateAssets="All" />
<PackageReference Include="SourceLink.Create.GitHub" Version="2.1.2" PrivateAssets="All" />
<DotNetCliToolReference Include="dotnet-sourcelink" Version="2.1.2" />
<DotNetCliToolReference Include="dotnet-sourcelink" Version="2.1.2" />
...
...
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