-
Notifications
You must be signed in to change notification settings - Fork 9.8k
/
StreamItemMessage.cs
32 lines (29 loc) · 1.04 KB
/
StreamItemMessage.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
32
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace Microsoft.AspNetCore.SignalR.Protocol
{
/// <summary>
/// Represents a single item of an active stream.
/// </summary>
public class StreamItemMessage : HubInvocationMessage
{
/// <summary>
/// The single item from a stream.
/// </summary>
public object? Item { get; set; }
/// <summary>
/// Constructs a <see cref="StreamItemMessage"/>.
/// </summary>
/// <param name="invocationId">The ID of the stream.</param>
/// <param name="item">An item from the stream.</param>
public StreamItemMessage(string invocationId, object? item) : base(invocationId)
{
Item = item;
}
/// <inheritdoc />
public override string ToString()
{
return $"StreamItem {{ {nameof(InvocationId)}: \"{InvocationId}\", {nameof(Item)}: {Item ?? "<<null>>"} }}";
}
}
}