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.Data;
using System.Linq;
......@@ -532,4 +531,3 @@ public async Task<int> InsertAsync(IDbConnection connection, IDbTransaction tran
return Convert.ToInt32(id);
}
}
#endif
#if ASYNC
using System;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
......@@ -210,4 +209,3 @@ public Task<int> UpdateAsync(TId id, dynamic data)
SqlMapper.QueryMultipleAsync(_connection, sql, param, transaction, commandTimeout, commandType);
}
}
#endif
\ No newline at end of file
......@@ -11,8 +11,7 @@ public EntityFrameworkTests()
{
EntityFramework.Handlers.Register();
}
#if ASYNC // TODO: Temp workaround in tests
[Fact]
public void Issue570_DbGeo_HasValues()
{
......@@ -27,7 +26,6 @@ public void Issue570_DbGeo_HasValues()
Assert.NotNull(fromDb.Area);
Assert.Equal(orig.Area, fromDb.Area);
}
#endif
[Fact]
public void Issue22_ExecuteScalar_EntityFramework()
......
......@@ -73,7 +73,6 @@ internal void OnCompleted()
/// </summary>
public bool Pipelined => (Flags & CommandFlags.Pipelined) != 0;
#if ASYNC
/// <summary>
/// Initialize the command definition
/// </summary>
......@@ -84,22 +83,9 @@ internal void OnCompleted()
/// <param name="commandType">The <see cref="CommandType"/> for this command.</param>
/// <param name="flags">The behavior flags 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,
CommandType? commandType = null, CommandFlags flags = CommandFlags.Buffered
#if ASYNC
, CancellationToken cancellationToken = default(CancellationToken)
#endif
)
{
CommandText = commandText;
......@@ -108,9 +94,7 @@ internal void OnCompleted()
CommandTimeout = commandTimeout;
CommandType = commandType;
Flags = flags;
#if ASYNC
CancellationToken = cancellationToken;
#endif
}
private CommandDefinition(object parameters) : this()
......@@ -118,13 +102,10 @@ private CommandDefinition(object parameters) : this()
Parameters = parameters;
}
#if ASYNC
/// <summary>
/// For asynchronous operations, the cancellation-token
/// </summary>
public CancellationToken CancellationToken { get; }
#endif
internal IDbCommand SetupCommand(IDbConnection cnn, Action<IDbCommand, object> paramReader)
{
......@@ -201,4 +182,4 @@ private static MethodInfo GetBasicPropertySetter(Type declaringType, string name
return null;
}
}
}
\ No newline at end of file
}
#if ASYNC
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
......@@ -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.Data;
using System.Data.Common;
......@@ -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
Home page: https://github.com/StackExchange/dapper-dot-net
*/
......@@ -516,13 +516,11 @@ private static int ExecuteImpl(this IDbConnection cnn, ref CommandDefinition com
CacheInfo info = null;
if (multiExec != null)
{
#if ASYNC
if((command.Flags & CommandFlags.Pipelined) != 0)
{
// this includes all the code for concurrent/overlapped query
return ExecuteMultiImplAsync(cnn, command, multiExec).Result;
}
#endif
bool isFirst = true;
int total = 0;
bool wasClosed = cnn.State == ConnectionState.Closed;
......@@ -3693,4 +3691,4 @@ private static string __ToStringRecycle(this StringBuilder obj)
return s;
}
}
}
\ No newline at end of file
}
......@@ -26,10 +26,6 @@
<Reference Include="System.Core" Pack="false" />
</ItemGroup>
<PropertyGroup Condition=" '$(TargetFramework)' != 'net40'">
<DefineConstants>$(DefineConstants);ASYNC</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SourceLink.Create.GitHub" Version="2.1.2" PrivateAssets="All" />
<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