~ruther/NosSmooth.Comms

ref: 5164e0aff7ef406c32e42516ce4790920af2ab83 NosSmooth.Comms/src/Core/NosSmooth.Comms.Core/NosSmoothResolver.cs -rw-r--r-- 788 bytes
5164e0af — František Boháček feat: add abstractions and core of communication 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
28
29
30
31
//
//  NosSmoothResolver.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 MessagePack;
using NosSmooth.Comms.Core.Formatters;

namespace NosSmooth.Comms.Core;

/// <summary>
/// A class for obtaining MessagePack formatter resolver.
/// </summary>
public class NosSmoothResolver
{
    /// <summary>
    /// Gets a formatter resolver for NosSmooth messages.
    /// </summary>
    public static IFormatterResolver Instance => MessagePack.Resolvers.CompositeResolver.Create
    (
        new[]
        {
            new NameStringFormatter()
        },
        new[]
        {
            MessagePackSerializer.Typeless.DefaultOptions.Resolver,
        }
    );
}
Do not follow this link