Beispiel #1
0
#pragma warning restore CA1823

        /// <summary>
        /// Constructs an <see cref="NpgsqlTypeHandler{TDefault}"/>.
        /// </summary>
        protected NpgsqlTypeHandler()
        {
            var item = NonGenericDelegateCache.GetOrAdd(GetType(), new Tuple <NonGenericValidateAndGetLength, NonGenericWriteWithLength>(GenerateNonGenericValidationMethod(GetType()), GenerateNonGenericWriteMethod(GetType(), typeof(INpgsqlTypeHandler <>))));

            _nonGenericValidateAndGetLength = item.Item1;
            _nonGenericWriteWithLength      = item.Item2;
        }
        /// <summary>
        /// Constructs an <see cref="NpgsqlSimpleTypeHandler{TDefault}"/>.
        /// </summary>
        protected NpgsqlSimpleTypeHandler()
        {
            // Get code-generated delegates for non-generic ValidateAndGetLength/WriteWithLengthInternal
            var item = NonGenericDelegateCache.GetOrAdd(GetType(), new Tuple <NonGenericValidateAndGetLength, NonGenericWriteWithLength>(GenerateNonGenericValidationMethod(GetType()), GenerateNonGenericWriteMethod(GetType(), typeof(INpgsqlSimpleTypeHandler <>))));

            _nonGenericValidateAndGetLength = item.Item1;
            _nonGenericWriteWithLength      = item.Item2;
        }