Skip to content

Commit d2e2f35

Browse files
committed
Added multi-targeting
1 parent a02d9ad commit d2e2f35

File tree

6 files changed

+20
-13
lines changed

6 files changed

+20
-13
lines changed

demo/DemoServer/Startup.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ public void ConfigureServices(IServiceCollection services)
3030
{
3131
o.ConnectionString = Configuration.GetConnectionString("Default");
3232
o.AutoEnableServiceBroker = true;
33-
o.TableCount = 50;
34-
//o.SchemaName = "Signalrcore";
33+
o.TableSlugGenerator = hubType => hubType.Name;
34+
o.TableCount = 1;
35+
o.SchemaName = "SignalRCore";
3536
});
3637
}
3738

src/IntelliTect.AspNetCore.SignalR.SqlServer/IntelliTect.AspNetCore.SignalR.SqlServer.csproj

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net5.0</TargetFramework>
4+
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net5.0</TargetFrameworks>
5+
<LangVersion>9.0</LangVersion>
56
<Nullable>enable</Nullable>
67
</PropertyGroup>
78

@@ -10,6 +11,16 @@
1011
<PackageReference Include="Microsoft.AspNetCore.SignalR.Core" Version="1.1.0" />
1112
<PackageReference Include="Microsoft.Data.SqlClient" Version="3.0.0" />
1213
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
14+
<PackageReference Include="System.Diagnostics.Tools" Version="4.3.0" />
15+
16+
<PackageReference Include="Nullable" Version="1.3.0">
17+
<PrivateAssets>all</PrivateAssets>
18+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
19+
</PackageReference>
20+
</ItemGroup>
21+
22+
<ItemGroup Condition="$(TargetFramework) == 'netstandard2.0'">
23+
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
1324
</ItemGroup>
1425

1526
<ItemGroup>

src/IntelliTect.AspNetCore.SignalR.SqlServer/Internal/AckHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void TriggerAck(int id)
4040
{
4141
if (_acks.TryRemove(id, out var ack))
4242
{
43-
ack.Tcs.TrySetResult();
43+
ack.Tcs.TrySetResult(true);
4444
}
4545
}
4646

@@ -86,13 +86,13 @@ public void Dispose()
8686

8787
private class AckInfo
8888
{
89-
public TaskCompletionSource Tcs { get; private set; }
89+
public TaskCompletionSource<bool> Tcs { get; private set; }
9090
public DateTime Created { get; private set; }
9191

9292
public AckInfo()
9393
{
9494
Created = DateTime.UtcNow;
95-
Tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
95+
Tcs = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
9696
}
9797
}
9898
}

src/IntelliTect.AspNetCore.SignalR.SqlServer/Internal/SqlServer/SqlSender.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,8 @@
33

44
using System;
55
using System.Collections.Generic;
6-
using System.Data;
7-
using System.Data.SqlClient;
8-
using System.Data.SqlTypes;
9-
using System.Diagnostics;
106
using System.Globalization;
117
using System.Threading.Tasks;
12-
using IntelliTect.AspNetCore.SignalR.SqlServer;
138
using Microsoft.Data.SqlClient;
149
using Microsoft.Extensions.Logging;
1510

src/IntelliTect.AspNetCore.SignalR.SqlServer/Internal/Util/MemoryBufferWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public void CopyTo(IBufferWriter<byte> destination)
137137

138138
public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
139139
{
140-
if (_completedSegments == null && _currentSegment is not null)
140+
if (_completedSegments == null && _currentSegment != null)
141141
{
142142
// There is only one segment so write without awaiting.
143143
return destination.WriteAsync(_currentSegment, 0, _position, cancellationToken);

src/IntelliTect.AspNetCore.SignalR.SqlServer/Internal/Util/NonCapturingTimer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System;
66
using System.Threading;
77

8-
namespace Microsoft.Extensions.Internal
8+
namespace IntelliTect.AspNetCore.SignalR.SqlServer.Internal
99
{
1010
// A convenience API for interacting with System.Threading.Timer in a way
1111
// that doesn't capture the ExecutionContext. We should be using this (or equivalent)

0 commit comments

Comments
 (0)