/// <summary>
        /// Gets a copy of these options with the <see cref="Compression"/> property set to a new value.
        /// </summary>
        /// <param name="compression">The new value for the <see cref="Compression"/> property.</param>
        /// <returns>The new instance; or the original if the value is unchanged.</returns>
        public MessagePackSerializerOptions WithCompression(MessagePackCompression compression)
        {
            if (this.Compression == compression)
            {
                return(this);
            }

            var result = this.Clone();

            result.Compression = compression;
            return(result);
        }
Esempio n. 2
0
 public static bool IsCompression(this MessagePackCompression compression)
 {
     return(compression != MessagePackCompression.None);
 }