Commit 7b34be3a authored by Nick Craver's avatar Nick Craver

net40 is dead - remove #if ASYNC bits

parent 6ce36492
#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
#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
...@@ -12,7 +12,6 @@ public EntityFrameworkTests() ...@@ -12,7 +12,6 @@ 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()
......
...@@ -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)
{ {
......
#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
#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
/* /*
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;
......
...@@ -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" />
......
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