Exemplo n.º 1
0
        static MultipleFormatterResolver()
        {
            _resolvers = new List <IFormatterResolver> {
                UnixTimestampFormetterResolver.Instance, PayloadFormtterResolver.Instance
            };

            Instance = new MultipleFormatterResolver();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create a new <see cref="MessagePackSerializer"/> instance.
        /// </summary>
        /// <param name="resolver">The storage of typed serializers.</param>
        public MessagePackSerializer(IFormatterResolver resolver)
        {
            if (resolver == null)
            {
                throw new ArgumentNullException(nameof(resolver));
            }

            MultipleFormatterResolver.AddFormatterResolver(resolver);
        }