Npgsql.NpgsqlParameter.NpgsqlParameter.Clone C# (CSharp) Method

Clone() public method

Creates a new NpgsqlParameter that is a copy of the current instance.
public Clone ( ) : Npgsql.NpgsqlParameter
return Npgsql.NpgsqlParameter
        public NpgsqlParameter Clone()
        {
            // use fields instead of properties
            // to avoid auto-initializing something like type_info
            var clone = new NpgsqlParameter
            {
                _precision = _precision,
                _scale = _scale,
                _size = _size,
                _dbType = _dbType,
                _npgsqlDbType = _npgsqlDbType,
                _specificType = _specificType,
                Direction = Direction,
                IsNullable = IsNullable,
                _name = _name,
                SourceColumn = SourceColumn,
#if NET45 || NET451
                SourceVersion = SourceVersion,
#endif
                _value = _value,
                _npgsqlValue = _npgsqlValue,
                SourceColumnNullMapping = SourceColumnNullMapping,
                AutoAssignedName = AutoAssignedName
            };
            return clone;
        }