-
Notifications
You must be signed in to change notification settings - Fork 9.9k
/
Hub`T.cs
31 lines (27 loc) · 896 Bytes
/
Hub`T.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Microsoft.AspNetCore.SignalR.Internal;
namespace Microsoft.AspNetCore.SignalR;
/// <summary>
/// A base class for a strongly typed SignalR hub.
/// </summary>
/// <typeparam name="T">The type of client.</typeparam>
public abstract class Hub<T> : Hub where T : class
{
private IHubCallerClients<T>? _clients;
/// <summary>
/// Gets or sets a <typeparamref name="T"/> that can be used to invoke methods on the clients connected to this hub.
/// </summary>
public new IHubCallerClients<T> Clients
{
get
{
if (_clients == null)
{
_clients = new TypedHubClients<T>(base.Clients);
}
return _clients;
}
set => _clients = value;
}
}