Skip to content

Commit ebd35aa

Browse files
committed
Fix NotSupportedException in MySqlParameter.
Set properties to their default versions as specified in MSDN documentation.
1 parent 3c6b5b7 commit ebd35aa

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

src/MySqlConnector/MySqlClient/MySqlParameter.cs

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@ public sealed class MySqlParameter : DbParameter
1111
public MySqlParameter()
1212
{
1313
m_mySqlDbType = MySqlDbType.VarChar;
14+
SourceColumn = "";
15+
#if !NETSTANDARD1_3
16+
SourceVersion = DataRowVersion.Current;
17+
#endif
1418
}
1519

1620
public MySqlParameter(string name, object objValue)
21+
: this()
1722
{
18-
m_mySqlDbType = MySqlDbType.VarChar;
1923
ParameterName = name;
2024
Value = objValue;
2125
}
@@ -73,24 +77,12 @@ public override string ParameterName
7377

7478
public override int Size { get; set; }
7579

76-
public override string SourceColumn
77-
{
78-
get { throw new NotSupportedException(); }
79-
set { throw new NotSupportedException(); }
80-
}
80+
public override string SourceColumn { get; set; }
8181

82-
public override bool SourceColumnNullMapping
83-
{
84-
get { throw new NotSupportedException(); }
85-
set { throw new NotSupportedException(); }
86-
}
82+
public override bool SourceColumnNullMapping { get; set; }
8783

8884
#if !NETSTANDARD1_3
89-
public override DataRowVersion SourceVersion
90-
{
91-
get { throw new NotSupportedException(); }
92-
set { throw new NotSupportedException(); }
93-
}
85+
public override DataRowVersion SourceVersion { get; set; }
9486
#endif
9587

9688
public override object Value { get; set; }

0 commit comments

Comments
 (0)