public async Task <bool> NotifyRealTimeClients(string vehicleId, bool status) { var notification = new VehicleStatusNotification(vehicleId, status); await _hubContext.Clients.All.InvokeAsync("vehicleStatusChanged", notification); return(true); }
public void Send(VehicleStatusNotification notification) { // Call the broadcastMessage method to update clients. Clients.All.InvokeAsync("vehicleStatusChanged", notification); }