Skip to content

Commit 4491d0d

Browse files
committed
Reduce warnings
1 parent f4705ee commit 4491d0d

6 files changed

Lines changed: 10 additions & 12 deletions

File tree

PowerSync/PowerSync.Common/Client/PowerSyncDatabase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ public async Task<UploadQueueStats> GetUploadQueueStats(bool includeSize = false
606606
///
607607
/// Use this from the <see cref="IPowerSyncBackendConnector.UploadData"/> callback.
608608
/// <para />
609-
/// Once the data have been successfully uploaded, call <see cref="CrudTransaction.Complete"/> before
609+
/// Once the data have been successfully uploaded, call <see cref="CrudBatch.Complete"/> before
610610
/// requesting the next transaction.
611611
/// <para />
612612
/// Unlike <see cref="GetCrudBatch"/>, this only returns data from a single transaction at a time.

PowerSync/PowerSync.Common/DB/Schema/Attributes/AttributeParser.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ public AttributeParser(Type type)
1818
{
1919
_type = type;
2020

21-
_tableAttr = _type.GetCustomAttribute<TableAttribute>();
22-
if (_tableAttr == null)
21+
var tableAttr = _type.GetCustomAttribute<TableAttribute>();
22+
if (tableAttr == null)
2323
{
2424
throw new InvalidOperationException("Table classes must be marked with TableAttribute.");
2525
}
26+
_tableAttr = tableAttr;
2627
}
2728

2829
public Table ParseTable()
@@ -194,7 +195,7 @@ public CustomPropertyTypeMap ParseDapperTypeMap()
194195
(type, columnName) => type.GetProperties()
195196
.FirstOrDefault(prop => prop.GetCustomAttributes()
196197
.OfType<ColumnAttribute>()
197-
.Any(columnAttr => columnAttr.Name == columnName))
198+
.Any(columnAttr => columnAttr.Name == columnName))!
198199
);
199200
}
200201

Tests/PowerSync/PowerSync.Common.IntegrationTests/PowerSync.Common.IntegrationTests.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0</TargetFrameworks>
55
<LangVersion>12</LangVersion>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>

Tests/PowerSync/PowerSync.Common.PerformanceTests/PowerSync.Common.PerformanceTests.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;net6.0;net8.0;net9.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0;net8.0;net9.0</TargetFrameworks>
55
<LangVersion>12</LangVersion>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>

Tests/PowerSync/PowerSync.Common.Tests/PowerSync.Common.Tests.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;net6.0;net8.0;net9.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0;net8.0;net9.0</TargetFrameworks>
55
<LangVersion>12</LangVersion>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>

demos/WPF/ViewModels/MainWindowViewModel.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,9 @@ public MainWindowViewModel(PowerSyncDatabase db)
3434
// Set up the listener to track the status changes
3535
_ = Task.Run(async () =>
3636
{
37-
await foreach (var update in _db.ListenAsync(new CancellationToken()))
37+
await foreach (var update in _db.Events.OnStatusChanged.ListenAsync(new CancellationToken()))
3838
{
39-
if (update.StatusChanged != null)
40-
{
41-
Connected = update.StatusChanged.Connected;
42-
}
39+
Connected = update.Status.Connected;
4340
}
4441
});
4542
}

0 commit comments

Comments
 (0)