mirror of
https://github.com/DapperLib/Dapper.git
synced 2026-10-26 02:30:00 +08:00
net40 is dead - remove #if ASYNC bits
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#if ASYNC
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
@@ -532,4 +531,3 @@ public partial class FbAdapter
|
||||
return Convert.ToInt32(id);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#if ASYNC
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
@@ -210,4 +209,3 @@ namespace Dapper
|
||||
SqlMapper.QueryMultipleAsync(_connection, sql, param, transaction, commandTimeout, commandType);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -11,8 +11,7 @@ namespace Dapper.Tests.Providers
|
||||
{
|
||||
EntityFramework.Handlers.Register();
|
||||
}
|
||||
|
||||
#if ASYNC // TODO: Temp workaround in tests
|
||||
|
||||
[Fact]
|
||||
public void Issue570_DbGeo_HasValues()
|
||||
{
|
||||
@@ -27,7 +26,6 @@ namespace Dapper.Tests.Providers
|
||||
Assert.NotNull(fromDb.Area);
|
||||
Assert.Equal(orig.Area, fromDb.Area);
|
||||
}
|
||||
#endif
|
||||
|
||||
[Fact]
|
||||
public void Issue22_ExecuteScalar_EntityFramework()
|
||||
|
||||
@@ -73,7 +73,6 @@ namespace Dapper
|
||||
/// </summary>
|
||||
public bool Pipelined => (Flags & CommandFlags.Pipelined) != 0;
|
||||
|
||||
#if ASYNC
|
||||
/// <summary>
|
||||
/// Initialize the command definition
|
||||
/// </summary>
|
||||
@@ -84,22 +83,9 @@ namespace Dapper
|
||||
/// <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 @@ namespace Dapper
|
||||
CommandTimeout = commandTimeout;
|
||||
CommandType = commandType;
|
||||
Flags = flags;
|
||||
#if ASYNC
|
||||
CancellationToken = cancellationToken;
|
||||
#endif
|
||||
}
|
||||
|
||||
private CommandDefinition(object parameters) : this()
|
||||
@@ -118,13 +102,10 @@ namespace Dapper
|
||||
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 @@ namespace Dapper
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#if ASYNC
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
@@ -1190,4 +1189,3 @@ namespace Dapper
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1,5 +1,4 @@
|
||||
#if ASYNC
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
@@ -246,4 +245,3 @@ namespace Dapper
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
+2
-4
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
License: http://www.apache.org/licenses/LICENSE-2.0
|
||||
Home page: https://github.com/StackExchange/dapper-dot-net
|
||||
*/
|
||||
@@ -516,13 +516,11 @@ namespace Dapper
|
||||
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 @@ namespace Dapper
|
||||
return s;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user