﻿[  
// ------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.'
// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations.
#pragma warning disable CS8669, CS8632
// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
#pragma warning disable CS1591
namespace generator;
public class VogenTypesFactory : global::System.Text.Json.Serialization.JsonConverterFactory
{
    public VogenTypesFactory()
    {
    }

    private static readonly global::System.Collections.Generic.Dictionary<global::System.Type, global::System.Lazy<global::System.Text.Json.Serialization.JsonConverter>> _lookup = new global::System.Collections.Generic.Dictionary<global::System.Type, global::System.Lazy<global::System.Text.Json.Serialization.JsonConverter>>
    {
        {
            typeof(global::Whatever.internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint),
            new global::System.Lazy<global::System.Text.Json.Serialization.JsonConverter>(() => new global::Whatever.internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint.internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterintSystemTextJsonConverter())
        }
    };
    public override bool CanConvert(global::System.Type typeToConvert) => _lookup.ContainsKey(typeToConvert);
    public override global::System.Text.Json.Serialization.JsonConverter CreateConverter(global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) => _lookup[typeToConvert].Value;
}
  
// ------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen)
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0618
// Suppress warnings for 'Override methods on comparable types'.
#pragma warning disable CA1036
// Suppress Error MA0097 : A class that implements IComparable<T> or IComparable should override comparison operators
#pragma warning disable MA0097
// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.'
// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations.
#pragma warning disable CS8669, CS8632
// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
#pragma warning disable CS1591
namespace Whatever
{
    [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Vogen", "1.0.0.0")]
    [global::System.Text.Json.Serialization.JsonConverter(typeof(internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterintSystemTextJsonConverter))]
    [global::Newtonsoft.Json.JsonConverter(typeof(internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterintNewtonsoftJsonConverter))]
    [global::System.Diagnostics.DebuggerTypeProxyAttribute(typeof(internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterintDebugView))]
    [global::System.Diagnostics.DebuggerDisplayAttribute("Underlying type: System.Int32, Value = { _value }")]
    internal partial record class internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint : global::System.IEquatable<internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint>, global::System.IEquatable<System.Int32>, global::System.IComparable<internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint>, global::System.IComparable, global::System.IParsable<internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint>, global::System.ISpanParsable<internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint>, global::System.IUtf8SpanParsable<internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint>, global::System.IFormattable, global::System.ISpanFormattable, global::System.IUtf8SpanFormattable
    {
#if DEBUG
private readonly global::System.Diagnostics.StackTrace _stackTrace = null!;
#endif
#if !VOGEN_NO_VALIDATION
        private readonly global::System.Boolean _isInitialized;
#endif
        private readonly System.Int32 _value;
        /// <summary>
        /// Gets the underlying <see cref = "System.Int32"/> value if set, otherwise a <see cref = "Vogen.ValueObjectValidationException"/> is thrown.
        /// </summary>
        public System.Int32 Value
        {
            [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
            [global::System.Diagnostics.DebuggerStepThroughAttribute]
            get
            {
                EnsureInitialized();
                return _value;
            }

            [global::System.Diagnostics.DebuggerStepThroughAttribute]
            init
            {
                _value = value;
            }
        }

        [global::System.Diagnostics.DebuggerStepThroughAttribute]
        [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
        public internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint()
        {
#if DEBUG
            _stackTrace = new global::System.Diagnostics.StackTrace();
#endif
#if !VOGEN_NO_VALIDATION
            _isInitialized = false;
#endif
            _value = default;
        }

        [global::System.Diagnostics.DebuggerStepThroughAttribute]
        private internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint(System.Int32 value)
        {
            _value = value;
#if !VOGEN_NO_VALIDATION
            _isInitialized = true;
#endif
        }

        /// <summary>
        /// Builds an instance from the provided underlying type.
        /// </summary>
        /// <param name = "value">The underlying type.</param>
        /// <returns>An instance of this type.</returns>
        [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
        public static internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint From(System.Int32 value)
        {
            return new internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint(value);
        }

        /// <summary>
        /// Tries to build an instance from the provided underlying type.
        /// If a normalization method is provided, it will be called.
        /// If validation is provided, and it fails, false will be returned.
        /// </summary>
        /// <param name = "value">The underlying type.</param>
        /// <param name = "vo">An instance of the value object.</param>
        /// <returns>True if the value object can be built, otherwise false.</returns>
        
#pragma warning disable CS8767 // Nullability of reference types in type of parameter doesn't match implicitly implemented member because of nullability attributes.

        public static bool TryFrom(
#if NETCOREAPP3_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
        System.Int32 value, 
#if NETCOREAPP3_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.MaybeNullWhen(false)]
#endif
        out internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint vo)
#pragma warning restore CS8767 // Nullability of reference types in type of parameter doesn't match implicitly implemented member because of nullability attributes.

        {
            vo = new internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint(value);
            return true;
        }

        /// <summary>
        /// Tries to build an instance from the provided underlying value.
        /// If a normalization method is provided, it will be called.
        /// If validation is provided, and it fails, an error will be returned.
        /// </summary>
        /// <param name = "value">The primitive value.</param>
        /// <returns>A <see cref = "Vogen.ValueObjectOrError{T}"/> containing either the value object, or an error.</returns>
        public static Vogen.ValueObjectOrError<internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint> TryFrom(System.Int32 value)
        {
            return new Vogen.ValueObjectOrError<internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint>(new internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint(value));
        }

        [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
#if VOGEN_NO_VALIDATION
#pragma warning disable CS8775
  public bool IsInitialized() => true;
#pragma warning restore CS8775
#else
        public bool IsInitialized() => _isInitialized;
#endif
        // only called internally when something has been deserialized into
        // its primitive type.
        private static internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint __Deserialize(System.Int32 value)
        {
            return new internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint(value);
        }

        public virtual global::System.Boolean Equals(internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }

            // It's possible to create uninitialized instances via converters such as EfCore (HasDefaultValue), which call Equals.
            // We treat anything uninitialized as not equal to anything, even other uninitialized instances of this type.
            if (!IsInitialized() || !other.IsInitialized())
                return false;
            if (ReferenceEquals(this, other))
            {
                return true;
            }

            return GetType() == other.GetType() && global::System.Collections.Generic.EqualityComparer<System.Int32>.Default.Equals(Value, other.Value);
        }

        public global::System.Boolean Equals(internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint other, global::System.Collections.Generic.IEqualityComparer<internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint> comparer)
        {
            return comparer.Equals(this, other);
        }

        public global::System.Boolean Equals(System.Int32 primitive)
        {
            return Value.Equals(primitive);
        }

        public static global::System.Boolean operator ==(internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint left, System.Int32 right) => left.Value.Equals(right);
        public static global::System.Boolean operator ==(System.Int32 left, internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint right) => right.Value.Equals(left);
        public static global::System.Boolean operator !=(System.Int32 left, internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint right) => !(left == right);
        public static global::System.Boolean operator !=(internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint left, System.Int32 right) => !(left == right);
        public static explicit operator internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint(System.Int32 value) => From(value);
        public static explicit operator System.Int32(internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint value) => value.Value;
        public int CompareTo(internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint other)
        {
            if (other is null)
                return 1;
            return Value.CompareTo(other.Value);
        }

        public int CompareTo(object other)
        {
            if (other is null)
                return 1;
            if (other is internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint x)
                return CompareTo(x);
            ThrowHelper.ThrowArgumentException("Cannot compare to object as it is not of type internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint", nameof(other));
            return 0;
        }

        /// <inheritdoc cref = "int.TryParse(System.ReadOnlySpan{byte}, System.Globalization.NumberStyles, System.IFormatProvider? , out int)"/>
        /// <summary>
        /// </summary>
        /// <returns>
        /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization).
        /// </returns>
        public static global::System.Boolean TryParse(global::System.ReadOnlySpan<byte> utf8Text, global::System.Globalization.NumberStyles style, global::System.IFormatProvider provider, 
#if NETCOREAPP3_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
        out internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint result)
        {
            if (System.Int32.TryParse(utf8Text, style, provider, out var __v))
            {
                result = new internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint(__v);
                return true;
            }

            result = default;
            return false;
        }

        /// <inheritdoc cref = "int.TryParse(System.ReadOnlySpan{byte}, System.IFormatProvider? , out int)"/>
        /// <summary>
        /// </summary>
        /// <returns>
        /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization).
        /// </returns>
        public static global::System.Boolean TryParse(global::System.ReadOnlySpan<byte> utf8Text, global::System.IFormatProvider provider, 
#if NETCOREAPP3_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
        out internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint result)
        {
            if (System.Int32.TryParse(utf8Text, provider, out var __v))
            {
                result = new internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint(__v);
                return true;
            }

            result = default;
            return false;
        }

        /// <inheritdoc cref = "int.TryParse(System.ReadOnlySpan{byte}, out int)"/>
        /// <summary>
        /// </summary>
        /// <returns>
        /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization).
        /// </returns>
        public static global::System.Boolean TryParse(global::System.ReadOnlySpan<byte> utf8Text, 
#if NETCOREAPP3_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
        out internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint result)
        {
            if (System.Int32.TryParse(utf8Text, out var __v))
            {
                result = new internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint(__v);
                return true;
            }

            result = default;
            return false;
        }

        /// <inheritdoc cref = "int.TryParse(System.ReadOnlySpan{char}, System.Globalization.NumberStyles, System.IFormatProvider? , out int)"/>
        /// <summary>
        /// </summary>
        /// <returns>
        /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization).
        /// </returns>
        public static global::System.Boolean TryParse(global::System.ReadOnlySpan<char> s, global::System.Globalization.NumberStyles style, global::System.IFormatProvider provider, 
#if NETCOREAPP3_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
        out internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint result)
        {
            if (System.Int32.TryParse(s, style, provider, out var __v))
            {
                result = new internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint(__v);
                return true;
            }

            result = default;
            return false;
        }

        /// <inheritdoc cref = "int.TryParse(System.ReadOnlySpan{char}, System.IFormatProvider? , out int)"/>
        /// <summary>
        /// </summary>
        /// <returns>
        /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization).
        /// </returns>
        public static global::System.Boolean TryParse(global::System.ReadOnlySpan<char> s, global::System.IFormatProvider provider, 
#if NETCOREAPP3_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
        out internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint result)
        {
            if (System.Int32.TryParse(s, provider, out var __v))
            {
                result = new internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint(__v);
                return true;
            }

            result = default;
            return false;
        }

        /// <inheritdoc cref = "int.TryParse(System.ReadOnlySpan{char}, out int)"/>
        /// <summary>
        /// </summary>
        /// <returns>
        /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization).
        /// </returns>
        public static global::System.Boolean TryParse(global::System.ReadOnlySpan<char> s, 
#if NETCOREAPP3_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
        out internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint result)
        {
            if (System.Int32.TryParse(s, out var __v))
            {
                result = new internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint(__v);
                return true;
            }

            result = default;
            return false;
        }

        /// <inheritdoc cref = "int.TryParse(string? , System.Globalization.NumberStyles, System.IFormatProvider? , out int)"/>
        /// <summary>
        /// </summary>
        /// <returns>
        /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization).
        /// </returns>
        public static global::System.Boolean TryParse(string s, global::System.Globalization.NumberStyles style, global::System.IFormatProvider provider, 
#if NETCOREAPP3_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
        out internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint result)
        {
            if (System.Int32.TryParse(s, style, provider, out var __v))
            {
                result = new internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint(__v);
                return true;
            }

            result = default;
            return false;
        }

        /// <inheritdoc cref = "int.TryParse(string? , System.IFormatProvider? , out int)"/>
        /// <summary>
        /// </summary>
        /// <returns>
        /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization).
        /// </returns>
        public static global::System.Boolean TryParse(string s, global::System.IFormatProvider provider, 
#if NETCOREAPP3_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
        out internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint result)
        {
            if (System.Int32.TryParse(s, provider, out var __v))
            {
                result = new internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint(__v);
                return true;
            }

            result = default;
            return false;
        }

        /// <inheritdoc cref = "int.TryParse(string? , out int)"/>
        /// <summary>
        /// </summary>
        /// <returns>
        /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization).
        /// </returns>
        public static global::System.Boolean TryParse(string s, 
#if NETCOREAPP3_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
        out internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint result)
        {
            if (System.Int32.TryParse(s, out var __v))
            {
                result = new internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint(__v);
                return true;
            }

            result = default;
            return false;
        }

        /// <inheritdoc cref = "int.Parse(System.ReadOnlySpan{byte}, System.Globalization.NumberStyles, System.IFormatProvider? )"/>
        /// <summary>
        /// </summary>
        /// <returns>
        /// The value created by calling the Parse method on the primitive.
        /// </returns>
        /// <exception cref = "global::Vogen.ValueObjectValidationException">Thrown when the value can be parsed, but is not valid.</exception>
        public static internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint Parse(global::System.ReadOnlySpan<byte> utf8Text, global::System.Globalization.NumberStyles style, global::System.IFormatProvider provider)
        {
            var r = System.Int32.Parse(utf8Text, style, provider);
            return From(r);
        }

        /// <inheritdoc cref = "int.Parse(System.ReadOnlySpan{byte}, System.IFormatProvider? )"/>
        /// <summary>
        /// </summary>
        /// <returns>
        /// The value created by calling the Parse method on the primitive.
        /// </returns>
        /// <exception cref = "global::Vogen.ValueObjectValidationException">Thrown when the value can be parsed, but is not valid.</exception>
        public static internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint Parse(global::System.ReadOnlySpan<byte> utf8Text, global::System.IFormatProvider provider)
        {
            var r = System.Int32.Parse(utf8Text, provider);
            return From(r);
        }

        /// <inheritdoc cref = "int.Parse(System.ReadOnlySpan{char}, System.Globalization.NumberStyles, System.IFormatProvider? )"/>
        /// <summary>
        /// </summary>
        /// <returns>
        /// The value created by calling the Parse method on the primitive.
        /// </returns>
        /// <exception cref = "global::Vogen.ValueObjectValidationException">Thrown when the value can be parsed, but is not valid.</exception>
        public static internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint Parse(global::System.ReadOnlySpan<char> s, global::System.Globalization.NumberStyles style, global::System.IFormatProvider provider)
        {
            var r = System.Int32.Parse(s, style, provider);
            return From(r);
        }

        /// <inheritdoc cref = "int.Parse(System.ReadOnlySpan{char}, System.IFormatProvider? )"/>
        /// <summary>
        /// </summary>
        /// <returns>
        /// The value created by calling the Parse method on the primitive.
        /// </returns>
        /// <exception cref = "global::Vogen.ValueObjectValidationException">Thrown when the value can be parsed, but is not valid.</exception>
        public static internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint Parse(global::System.ReadOnlySpan<char> s, global::System.IFormatProvider provider)
        {
            var r = System.Int32.Parse(s, provider);
            return From(r);
        }

        /// <inheritdoc cref = "int.Parse(string)"/>
        /// <summary>
        /// </summary>
        /// <returns>
        /// The value created by calling the Parse method on the primitive.
        /// </returns>
        /// <exception cref = "global::Vogen.ValueObjectValidationException">Thrown when the value can be parsed, but is not valid.</exception>
        public static internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint Parse(string s)
        {
            var r = System.Int32.Parse(s);
            return From(r);
        }

        /// <inheritdoc cref = "int.Parse(string, System.Globalization.NumberStyles)"/>
        /// <summary>
        /// </summary>
        /// <returns>
        /// The value created by calling the Parse method on the primitive.
        /// </returns>
        /// <exception cref = "global::Vogen.ValueObjectValidationException">Thrown when the value can be parsed, but is not valid.</exception>
        public static internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint Parse(string s, global::System.Globalization.NumberStyles style)
        {
            var r = System.Int32.Parse(s, style);
            return From(r);
        }

        /// <inheritdoc cref = "int.Parse(string, System.Globalization.NumberStyles, System.IFormatProvider? )"/>
        /// <summary>
        /// </summary>
        /// <returns>
        /// The value created by calling the Parse method on the primitive.
        /// </returns>
        /// <exception cref = "global::Vogen.ValueObjectValidationException">Thrown when the value can be parsed, but is not valid.</exception>
        public static internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint Parse(string s, global::System.Globalization.NumberStyles style, global::System.IFormatProvider provider)
        {
            var r = System.Int32.Parse(s, style, provider);
            return From(r);
        }

        /// <inheritdoc cref = "int.Parse(string, System.IFormatProvider? )"/>
        /// <summary>
        /// </summary>
        /// <returns>
        /// The value created by calling the Parse method on the primitive.
        /// </returns>
        /// <exception cref = "global::Vogen.ValueObjectValidationException">Thrown when the value can be parsed, but is not valid.</exception>
        public static internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint Parse(string s, global::System.IFormatProvider provider)
        {
            var r = System.Int32.Parse(s, provider);
            return From(r);
        }

#nullable disable
        /// <inheritdoc cref = "int.ToString(string? , System.IFormatProvider? )"/>
        public string ToString([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("NumericFormat")] string format, global::System.IFormatProvider provider)
        {
            return IsInitialized() ? Value.ToString(format, provider) : "[UNINITIALIZED]";
        }

        /// <inheritdoc cref = "int.TryFormat(System.Span{char}, out int, System.ReadOnlySpan{char}, System.IFormatProvider? )"/>
        public bool TryFormat(global::System.Span<char> destination, out int charsWritten, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("NumericFormat")] global::System.ReadOnlySpan<char> format, global::System.IFormatProvider provider)
        {
            charsWritten = default;
            return IsInitialized() ? Value.TryFormat(destination, out charsWritten, format, provider) : true;
        }

        /// <inheritdoc cref = "int.TryFormat(System.Span{byte}, out int, System.ReadOnlySpan{char}, System.IFormatProvider? )"/>
        public bool TryFormat(global::System.Span<byte> utf8Destination, out int bytesWritten, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("NumericFormat")] global::System.ReadOnlySpan<char> format, global::System.IFormatProvider provider)
        {
            bytesWritten = default;
            return IsInitialized() ? Value.TryFormat(utf8Destination, out bytesWritten, format, provider) : true;
        }

#nullable restore
        public override global::System.Int32 GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                global::System.Int32 hash = (global::System.Int32)2166136261;
                hash = (hash * 16777619) ^ GetType().GetHashCode();
                hash = (hash * 16777619) ^ global::System.Collections.Generic.EqualityComparer<System.Int32>.Default.GetHashCode(Value);
                return hash;
            }
        }

        [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
        private void EnsureInitialized()
        {
            if (!IsInitialized())
            {
#if DEBUG
               ThrowHelper.ThrowWhenNotInitialized(_stackTrace);
#else
                ThrowHelper.ThrowWhenNotInitialized();
#endif
            }
        }

        // record enumerates fields - we just want our Value and to throw if it's not initialized.
        /// <inheritdoc cref = "System.Int32.ToString()"/>
        public override global::System.String ToString() => IsInitialized() ? Value.ToString() ?? "" : "[UNINITIALIZED]";
        /// <inheritdoc cref = "System.Int32.ToString(System.IFormatProvider? )"/>
        public global::System.String ToString(global::System.IFormatProvider provider) => IsInitialized() ? Value.ToString(provider) ?? "" : "[UNINITIALIZED]";
        /// <inheritdoc cref = "System.Int32.ToString(string? )"/>
        public global::System.String ToString([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("NumericFormat")] string format) => IsInitialized() ? Value.ToString(format) ?? "" : "[UNINITIALIZED]";
#nullable disable
        /// <summary>
        /// Converts a internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint to or from JSON.
        /// </summary>
        public class internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterintSystemTextJsonConverter : global::System.Text.Json.Serialization.JsonConverter<internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint>
        {
            public override internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint Read(ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options)
            {
#if NET5_0_OR_GREATER
                return DeserializeJson(global::System.Text.Json.JsonSerializer.Deserialize(ref reader, (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Int32>)options.GetTypeInfo(typeof(global::System.Int32))));
#else
                return DeserializeJson(reader.GetInt32());
#endif
            }

            public override void Write(System.Text.Json.Utf8JsonWriter writer, internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint value, global::System.Text.Json.JsonSerializerOptions options)
            {
#if NET5_0_OR_GREATER
                global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value, options);
#else
                writer.WriteNumberValue(value.Value);
#endif
            }

#if NET6_0_OR_GREATER
            public override internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint ReadAsPropertyName(ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options)
            {
                return DeserializeJson(global::System.Int32.Parse(reader.GetString(), global::System.Globalization.NumberStyles.Any, global::System.Globalization.CultureInfo.InvariantCulture));
            }

            public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint value, global::System.Text.Json.JsonSerializerOptions options)
            {
                writer.WritePropertyName(value.Value.ToString(global::System.Globalization.CultureInfo.InvariantCulture));
            }
#endif
#if NETCOREAPP3_0_OR_GREATER
            [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute]
#endif
            private static void ThrowJsonExceptionWhenValidationFails(Vogen.Validation validation)
            {
                var e = ThrowHelper.CreateValidationException(validation);
                throw new global::System.Text.Json.JsonException(null, e);
            }

            public static internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint DeserializeJson(System.Int32 value)
            {
                return new internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint(value);
            }
        }

#nullable restore
#nullable disable
        class internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterintNewtonsoftJsonConverter : Newtonsoft.Json.JsonConverter
        {
            public override bool CanConvert(System.Type objectType)
            {
                return objectType == typeof(internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint);
            }

            public override void WriteJson(Newtonsoft.Json.JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer)
            {
                var id = (internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint)value;
                serializer.Serialize(writer, id.Value);
            }

            public override object ReadJson(Newtonsoft.Json.JsonReader reader, System.Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer)
            {
                var result = serializer.Deserialize<global::System.Int32?>(reader);
                return result.HasValue ? internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint.__Deserialize(result.Value) : null;
            }
        }

#nullable restore
#nullable disable
        public class DapperTypeHandler : global::Dapper.SqlMapper.TypeHandler<internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint>
        {
            public override void SetValue(global::System.Data.IDbDataParameter parameter, internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint value)
            {
                parameter.DbType = global::System.Data.DbType.Int32;
                parameter.Value = value.Value;
            }

            public override internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint Parse(object value)
            {
                return value switch
                {
                    global::System.Int32 intValue => internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint.__Deserialize(intValue),
                    global::System.Int64 longValue when longValue < global::System.Int32.MaxValue => internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint.__Deserialize((global::System.Int32)longValue),
                    global::System.String stringValue when !global::System.String.IsNullOrEmpty(stringValue) && global::System.Int32.TryParse(stringValue, out var result) => internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint.__Deserialize(result),
                    _ => throw new global::System.InvalidCastException($"Unable to cast object of type {value.GetType()} to internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint"),
                };
            }
        }

#nullable restore
#nullable disable
        public class EfCoreValueConverter : global::Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter<internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint, System.Int32>
        {
            public EfCoreValueConverter() : this(null)
            {
            }

            public EfCoreValueConverter(global::Microsoft.EntityFrameworkCore.Storage.ValueConversion.ConverterMappingHints mappingHints = null) : base(vo => vo.Value, value => internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint.__Deserialize(value), mappingHints)
            {
            }
        }

        public class EfCoreValueComparer : global::Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer<internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint>
        {
            public EfCoreValueComparer() : base((left, right) => DoCompare(left, right), instance => instance.IsInitialized() ? instance._value.GetHashCode() : 0)
            {
            }

            static bool DoCompare(internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint left, internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint right)
            {
                // if both null, then they're equal
                if (left is null)
                    return right is null;
                // if only right is null, then they're not equal
                if (right is null)
                    return false;
                // if they're both the same reference, then they're equal
                if (ReferenceEquals(left, right))
                    return true;
                // if neither are initialized, then they're equal
                if (!left.IsInitialized() && !right.IsInitialized())
                    return true;
                return left.IsInitialized() && right.IsInitialized() && left._value.Equals(right._value);
            }
        }

#nullable restore
#nullable disable
        public class LinqToDbValueConverter : global::LinqToDB.Common.ValueConverter<internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint, global::System.Int32>
        {
            public LinqToDbValueConverter() : base(v => v.Value, p => internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint.__Deserialize(p), handlesNulls: false)
            {
            }
        }

#nullable restore
        internal sealed class internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterintDebugView
        {
            private readonly internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint _t;
            internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterintDebugView(internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint t)
            {
                _t = t;
            }

            public global::System.String UnderlyingType => "System.Int32";
            public System.Int32 Value => _t.Value;
            public global::System.String Conversions => @"[global::System.Text.Json.Serialization.JsonConverter(typeof(internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterintSystemTextJsonConverter))]
[global::Newtonsoft.Json.JsonConverter(typeof(internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterintNewtonsoftJsonConverter))]
";
        }

        static class ThrowHelper
        {
#if NETCOREAPP3_0_OR_GREATER
    [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute]
#endif
            internal static void ThrowInvalidOperationException(string message) => throw new global::System.InvalidOperationException(message);
#if NETCOREAPP3_0_OR_GREATER
    [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute]
#endif
            internal static void ThrowArgumentException(string message, string arg) => throw new global::System.ArgumentException(message, arg);
#if NETCOREAPP3_0_OR_GREATER
    [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute]
#endif
            internal static void ThrowWhenCreatedWithNull() => throw CreateCannotBeNullException();
#if NETCOREAPP3_0_OR_GREATER
    [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute]
#endif
            internal static void ThrowWhenNotInitialized() => throw CreateValidationException("Use of uninitialized Value Object.");
#if NETCOREAPP3_0_OR_GREATER
    [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute]
#endif
            internal static void ThrowWhenNotInitialized(global::System.Diagnostics.StackTrace stackTrace) => throw CreateValidationException("Use of uninitialized Value Object at: " + stackTrace ?? "");
#if NETCOREAPP3_0_OR_GREATER
    [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute]
#endif
            internal static void ThrowWhenValidationFails(Vogen.Validation validation)
            {
                throw CreateValidationException(validation);
            }

            internal static System.Exception CreateValidationException(string message) => new global::Vogen.ValueObjectValidationException(message);
            internal static System.Exception CreateCannotBeNullException() => new global::Vogen.ValueObjectValidationException("Cannot create a value object with null.");
            internal static System.Exception CreateValidationException(Vogen.Validation validation)
            {
                var ex = CreateValidationException(validation.ErrorMessage);
                if (validation.Data is not null)
                {
                    foreach (var kvp in validation.Data)
                    {
                        ex.Data[kvp.Key] = kvp.Value;
                    }
                }

                return ex;
            }
        }
    }
#if NETCOREAPP3_0_OR_GREATER
            public static class __internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterintEfCoreExtensions 
            {
                internal static global::Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint> HasVogenConversion(this global::Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint> propertyBuilder) =>
                    propertyBuilder.HasConversion<internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint.EfCoreValueConverter, internal_partial_recordConversions_NewtonsoftJson___Conversions_SystemTextJson___Conversions_EfCoreValueConverter___Conversions_DapperTypeHandler___Conversions_LinqToDbValueConverterint.EfCoreValueComparer>();
            }
#endif
}
]