diff --git a/PowerSync/PowerSync.Common/Client/PowerSyncDatabase.cs b/PowerSync/PowerSync.Common/Client/PowerSyncDatabase.cs index bcd819a..d547ec2 100644 --- a/PowerSync/PowerSync.Common/Client/PowerSyncDatabase.cs +++ b/PowerSync/PowerSync.Common/Client/PowerSyncDatabase.cs @@ -606,7 +606,7 @@ public async Task GetUploadQueueStats(bool includeSize = false /// /// Use this from the callback. /// - /// Once the data have been successfully uploaded, call before + /// Once the data have been successfully uploaded, call before /// requesting the next transaction. /// /// Unlike , this only returns data from a single transaction at a time. diff --git a/PowerSync/PowerSync.Common/DB/Schema/Attributes/AttributeParser.cs b/PowerSync/PowerSync.Common/DB/Schema/Attributes/AttributeParser.cs index 5344316..675feca 100644 --- a/PowerSync/PowerSync.Common/DB/Schema/Attributes/AttributeParser.cs +++ b/PowerSync/PowerSync.Common/DB/Schema/Attributes/AttributeParser.cs @@ -18,11 +18,12 @@ public AttributeParser(Type type) { _type = type; - _tableAttr = _type.GetCustomAttribute(); - if (_tableAttr == null) + var tableAttr = _type.GetCustomAttribute(); + if (tableAttr == null) { throw new InvalidOperationException("Table classes must be marked with TableAttribute."); } + _tableAttr = tableAttr; } public Table ParseTable() @@ -194,7 +195,7 @@ public CustomPropertyTypeMap ParseDapperTypeMap() (type, columnName) => type.GetProperties() .FirstOrDefault(prop => prop.GetCustomAttributes() .OfType() - .Any(columnAttr => columnAttr.Name == columnName)) + .Any(columnAttr => columnAttr.Name == columnName))! ); } diff --git a/Tests/PowerSync/PowerSync.Common.IntegrationTests/PowerSync.Common.IntegrationTests.csproj b/Tests/PowerSync/PowerSync.Common.IntegrationTests/PowerSync.Common.IntegrationTests.csproj index f387380..3d029a9 100644 --- a/Tests/PowerSync/PowerSync.Common.IntegrationTests/PowerSync.Common.IntegrationTests.csproj +++ b/Tests/PowerSync/PowerSync.Common.IntegrationTests/PowerSync.Common.IntegrationTests.csproj @@ -1,7 +1,7 @@  - netstandard2.0;net8.0 + net8.0 12 enable enable diff --git a/Tests/PowerSync/PowerSync.Common.PerformanceTests/PowerSync.Common.PerformanceTests.csproj b/Tests/PowerSync/PowerSync.Common.PerformanceTests/PowerSync.Common.PerformanceTests.csproj index 369abbc..25d9697 100644 --- a/Tests/PowerSync/PowerSync.Common.PerformanceTests/PowerSync.Common.PerformanceTests.csproj +++ b/Tests/PowerSync/PowerSync.Common.PerformanceTests/PowerSync.Common.PerformanceTests.csproj @@ -1,7 +1,7 @@  - netstandard2.0;net6.0;net8.0;net9.0 + net6.0;net8.0;net9.0 12 enable enable diff --git a/Tests/PowerSync/PowerSync.Common.Tests/PowerSync.Common.Tests.csproj b/Tests/PowerSync/PowerSync.Common.Tests/PowerSync.Common.Tests.csproj index bc9c910..a153f06 100644 --- a/Tests/PowerSync/PowerSync.Common.Tests/PowerSync.Common.Tests.csproj +++ b/Tests/PowerSync/PowerSync.Common.Tests/PowerSync.Common.Tests.csproj @@ -1,7 +1,7 @@ - netstandard2.0;net6.0;net8.0;net9.0 + net6.0;net8.0;net9.0 12 enable enable diff --git a/demos/WPF/ViewModels/MainWindowViewModel.cs b/demos/WPF/ViewModels/MainWindowViewModel.cs index 0312d2f..92adc02 100644 --- a/demos/WPF/ViewModels/MainWindowViewModel.cs +++ b/demos/WPF/ViewModels/MainWindowViewModel.cs @@ -34,12 +34,9 @@ public MainWindowViewModel(PowerSyncDatabase db) // Set up the listener to track the status changes _ = Task.Run(async () => { - await foreach (var update in _db.ListenAsync(new CancellationToken())) + await foreach (var update in _db.Events.OnStatusChanged.ListenAsync(new CancellationToken())) { - if (update.StatusChanged != null) - { - Connected = update.StatusChanged.Connected; - } + Connected = update.Status.Connected; } }); }