~ruther/NosSmooth.Comms

ref: 2d0c91b61599398f037d97a8d6288736e01082d9 NosSmooth.Comms/src/Local/NosSmooth.Comms.Local/Extensions/ConnectionHandlerExtensions.cs -rw-r--r-- 1.0 KiB
2d0c91b6 — František Boháček chore: bump versions 2 years ago
                                                                                
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
//
//  ConnectionHandlerExtensions.cs
//
//  Copyright (c) František Boháček. All rights reserved.
//  Licensed under the MIT license. See LICENSE file in the project root for full license information.

using NosSmooth.Comms.Core;
using NosSmooth.Comms.Inject.Messages;
using NosSmooth.Core.Contracts;

namespace NosSmooth.Comms.Local.Extensions;

/// <summary>
/// Extension methods for <see cref="ConnectionHandler"/>.
/// </summary>
public static class ConnectionHandlerExtensions
{
    /// <summary>
    /// Contract <see cref="RunClientRequest"/>, <see cref="RunClientResponse"/>.
    /// </summary>
    /// <param name="connectionHandler">The connection handler.</param>
    /// <param name="message">The request.</param>
    /// <returns>The contract.</returns>
    public static IContract<RunClientResponse, DefaultStates> ContractRunClient
        (this ConnectionHandler connectionHandler, RunClientRequest message)
        => connectionHandler.ContractCustomResponse<RunClientRequest, RunClientResponse>(message, _ => true);
}
Do not follow this link