@@ -52,7 +52,7 @@ public class DataSetChecker : IDisposable
52
52
new ( @"^[\p{L}\p{Nd}@#$_]+$" , RegexOptions . Compiled | RegexOptions . CultureInvariant ) ;
53
53
54
54
private readonly SqlConnection sqlConnectionFmtOnly ;
55
- private readonly SqlConnection sqlConnectionSpDescribe ;
55
+ private readonly SqlConnection ? sqlConnectionSpDescribe ;
56
56
private bool disposedValue ;
57
57
58
58
/// <summary>
@@ -99,7 +99,7 @@ public DataSetChecker(string connectionString)
99
99
}
100
100
}
101
101
102
- public event EventHandler < DataSetCheckerEventArgs > DataSetCheckerEventHandler ;
102
+ public event EventHandler < DataSetCheckerEventArgs > ? DataSetCheckerEventHandler ;
103
103
104
104
/// <summary>
105
105
/// Entry-point to check a named XSD against a given collection.
@@ -136,7 +136,7 @@ public static int Main(string[] args)
136
136
}
137
137
138
138
int exitCode = 0 ;
139
- using ( DataSetChecker checker = new ( options . ConnectionString ) )
139
+ using ( DataSetChecker checker = new ( options . ConnectionString ! ) )
140
140
{
141
141
checker . DataSetCheckerEventHandler += ( object sender , DataSetCheckerEventArgs eventArgs ) =>
142
142
{
@@ -247,8 +247,8 @@ protected void CheckDbCommand(XmlNode dbCommand)
247
247
throw new ArgumentNullException ( nameof ( dbCommand ) ) ;
248
248
}
249
249
250
- string commandText = null ;
251
- List < SqlParameter > sqlParameters = null ;
250
+ string ? commandText = null ;
251
+ List < SqlParameter > ? sqlParameters = null ;
252
252
foreach ( XmlNode childNode in dbCommand . ChildNodes )
253
253
{
254
254
if ( childNode . NamespaceURI != DataSetConstants . MsDsNamespace )
@@ -391,7 +391,7 @@ protected void CheckDbCommand(XmlNode dbCommand)
391
391
protected void CheckCommand (
392
392
string commandText ,
393
393
CommandType commandType ,
394
- ICollection < SqlParameter > sqlParameters )
394
+ ICollection < SqlParameter > ? sqlParameters )
395
395
{
396
396
if ( this . sqlConnectionSpDescribe != null )
397
397
{
@@ -400,7 +400,7 @@ protected void CheckCommand(
400
400
401
401
if ( this . sqlConnectionFmtOnly != null )
402
402
{
403
- SqlParameter [ ] sqlParametersArray = null ;
403
+ SqlParameter [ ] ? sqlParametersArray = null ;
404
404
if ( sqlParameters != null )
405
405
{
406
406
sqlParametersArray = new SqlParameter [ sqlParameters . Count ] ;
@@ -418,7 +418,7 @@ protected void CheckCommand(
418
418
protected void CheckCommandFormatOnly (
419
419
string commandText ,
420
420
CommandType commandType ,
421
- SqlParameter [ ] sqlParameters )
421
+ SqlParameter [ ] ? sqlParameters )
422
422
{
423
423
using SqlCommand sqlCommand = new ( commandText , this . sqlConnectionFmtOnly ) ;
424
424
sqlCommand . CommandType = commandType ;
@@ -432,7 +432,7 @@ protected void CheckCommandFormatOnly(
432
432
433
433
protected void CheckCommandSPDescribe (
434
434
string commandText ,
435
- IEnumerable < SqlParameter > sqlParameters )
435
+ IEnumerable < SqlParameter > ? sqlParameters )
436
436
{
437
437
string paramsDecl = this . GetSqlDeclaration ( sqlParameters ) ;
438
438
using SqlCommand sqlCommand = new ( "sp_describe_first_result_set" , this . sqlConnectionSpDescribe ) ;
@@ -572,7 +572,7 @@ private static XmlNamespaceManager CreateNamespaceManager()
572
572
}
573
573
574
574
// FIXME: Is this really not implemented somewhere in ADO.NET?
575
- private string GetSqlDeclaration ( IEnumerable < SqlParameter > parameters )
575
+ private string GetSqlDeclaration ( IEnumerable < SqlParameter > ? parameters )
576
576
{
577
577
if ( parameters == null )
578
578
{
@@ -612,7 +612,7 @@ private string GetSqlDeclaration(IEnumerable<SqlParameter> parameters)
612
612
return declaration . ToString ( 0 , declaration . Length - 2 ) ;
613
613
}
614
614
615
- private void LogError ( string message , XmlNode node , Exception exception = null )
615
+ private void LogError ( string message , XmlNode ? node , Exception ? exception = null )
616
616
{
617
617
// FIXME: Throw if no EventHandler?
618
618
DataSetCheckerEventArgs eventArgs = new (
@@ -623,7 +623,7 @@ private void LogError(string message, XmlNode node, Exception exception = null)
623
623
this . OnDataSetCheckerEventHandler ( eventArgs ) ;
624
624
}
625
625
626
- private void LogWarning ( string message , XmlNode node , Exception exception = null )
626
+ private void LogWarning ( string message , XmlNode ? node , Exception ? exception = null )
627
627
{
628
628
// FIXME: Throw if no EventHandler?
629
629
DataSetCheckerEventArgs eventArgs = new (
0 commit comments