- ABP Framework version: v8.0++
- UI type: Blazor
- DB provider: EF Core
I want to refresh data on a Blazor page when data in the collection changes. Do you have any advice / recommendations?
Currently I use a timer but periodically get the exception below - it occurs when one of the clients disconnects.
System.ObjectDisposedException HResult=0x80131622 Message=Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it (or one of its parent scopes) has already been disposed.
I'm considering implementing an INotifyCollectionChanged / Observable Collection: https://blazor.syncfusion.com/documentation/common/data-binding/data-updates But I'm not sure of the correct approach.
Any advice would be appreciated.
3 Answer(s)
-
0
Hi
Yes, it's recommended.
ABP also used
INotifyCollectionChanged
https://github.com/abpframework/abp/blob/e6e91bf11cd219ccab72633b13994dc5be2d2932/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageLayout.cs -
0
Thanks, but the updates to the collection can be from any client.
I want to set the NotificationChange at the repository level so that a change from 1 client triggers updates to all clients.Can, for example, the NotificationChange be implemented in the Domain Manager and for that to trigger Observable Collection updates?
-
0
Hi,
No, it's not possible. Blazor and the backend are independent processes.
You can consider using SignalR.