Пример #1
0
        public GameService(NavigationManager navigationManager, IServiceProvider serviceProvider, IToastService toastService)
        {
            _serviceProvider = serviceProvider;
            _toastService    = toastService;

            Uri hubUri = navigationManager.ToAbsoluteUri(HubUrls.GameHub);

            _hubConnection =
                new HubConnectionBuilder()
                .WithAutomaticReconnect()
                .WithUrl(hubUri)
                .Build();

            _hubConnection.Bind <IGameHubEvents>(this);
        }