Repository: dotnet/aspnetcore
File: src/SignalR/server/Core/src/DynamicHubClients.cs (C#)

Code before:
﻿// 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 class that provides <c>dynamic</c> access to connections, including the one that sent the current invocation.
/// </summary>
public class DynamicHubClients
{
    private readonly IHubCallerClients _clients;

    /// <summary>
    /// Initializes a new instance of the <see cref="DynamicHubClients"/> class.
    /// </summary>
    /// <param name="clients">A wrapped <see cref="IHubCallerClients"/> that is used to invoke methods.</param>
    public DynamicHubClients(IHubCallerClients clients)
    {
        _clients = clients;
    }

    /// <summary>
    /// Gets an object that can be used to invoke methods on all clients connected to the hub.
    /// </summary>
    /// <returns>An object that can be used to invoke methods on the specified user.</returns>
    public dynamic All => new DynamicClientProxy(_clients.All);

    /// <summary>
    /// Gets an object that can be used to invoke methods on all clients connected to the hub excluding the specified connections.
    /// </summary>
    /// <param name="excludedConnectionIds">A collection of connection IDs to exclude.</param>
    /// <returns>An object that can be used to invoke methods on the specified user.</returns>
    public dynamic AllExcept(IReadOnlyList<string> excludedConnectionIds) => new DynamicClientProxy(_clients.AllExcept(excludedConnectionIds));


Review comment (suggestion):
```suggestion
[RequiresDynamicCodeAttribute("DynamicHubClients requires dynamic code generation to construct a call site.")]
public class DynamicHubClients
```

Code after:
﻿// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Diagnostics.CodeAnalysis;
using Microsoft.AspNetCore.SignalR.Internal;

namespace Microsoft.AspNetCore.SignalR;

/// <summary>
/// A class that provides <c>dynamic</c> access to connections, including the one that sent the current invocation.
/// </summary>
[RequiresDynamicCodeAttribute("DynamicHubClients requires dynamic code generation to construct a call site.")]
public class DynamicHubClients
{
    private readonly IHubCallerClients _clients;

    /// <summary>
    /// Initializes a new instance of the <see cref="DynamicHubClients"/> class.
    /// </summary>
    /// <param name="clients">A wrapped <see cref="IHubCallerClients"/> that is used to invoke methods.</param>
    public DynamicHubClients(IHubCallerClients clients)
    {
        _clients = clients;
    }

    /// <summary>
    /// Gets an object that can be used to invoke methods on all clients connected to the hub.
    /// </summary>
    /// <returns>An object that can be used to invoke methods on the specified user.</returns>
    public dynamic All => new DynamicClientProxy(_clients.All);

    /// <summary>
    /// Gets an object that can be used to invoke methods on all clients connected to the hub excluding the specified connections.
    /// </summary>
    /// <param name="excludedConnectionIds">A collection of connection IDs to exclude.</param>
    /// <returns>An object that can be used to invoke methods on the specified user.</returns>