Skip to content

Commit ec5627f

Browse files
authored
Improve exception message in AseParameter ctor
Make exception message for ArgumentNullException thrown by 'AseParameter(string,object)' more friendly by including parameterName and an explanation for how to insert null values.
1 parent 886baa2 commit ec5627f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/AdoNetCore.AseClient/AseParameter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public AseParameter()
4040
/// <param name="value">An object that is the value of the parameter.</param>
4141
public AseParameter(string parameterName, object value) : this()
4242
{
43-
Value = value ?? throw new ArgumentNullException();
43+
Value = value ?? throw new ArgumentNullException($"Value for parameter '{parameterName}' cannot be null! If you meant to insert NULL, use DbNull.Value instead.");
4444
ParameterName = parameterName;
4545
}
4646

0 commit comments

Comments
 (0)