All Downloads are FREE. Search and download functionalities are using the official Maven repository.

csharp.libraries.generichost.Option.mustache Maven / Gradle / Ivy

There is a newer version: 7.9.0
Show newest version
// 
{{>partial_header}}
{{#nrt}}
#nullable enable

{{/nrt}}

namespace {{packageName}}.{{clientPackage}}
{
    /// 
    /// A wrapper for operation parameters which are not required
    /// 
    public struct Option
    {
        /// 
        /// The value to send to the server
        /// 
        public TType Value { get; }

        /// 
        /// When true the value will be sent to the server
        /// 
        internal bool IsSet { get; }

        /// 
        /// A wrapper for operation parameters which are not required
        /// 
        /// 
        public Option(TType value)
        {
            IsSet = true;
            Value = value;
        }

        /// 
        /// Implicitly converts this option to the contained type
        /// 
        /// 
        public static implicit operator TType(Option option) => option.Value;

        /// 
        /// Implicitly converts the provided value to an Option
        /// 
        /// 
        public static implicit operator Option(TType value) => new Option(value);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy