File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 33using System . Data ;
44using System . Linq ;
55using System . Text ;
6+ using Shuttle . Core . Contract ;
67using Shuttle . Core . Logging ;
78
89namespace Shuttle . Core . Data
@@ -18,6 +19,8 @@ public DatabaseGateway()
1819
1920 public DataTable GetDataTableFor ( IQuery query )
2021 {
22+ Guard . AgainstNull ( query , nameof ( query ) ) ;
23+
2124 using ( var reader = GetReaderUsing ( query ) )
2225 {
2326 var results = new DataTable ( ) ;
@@ -62,6 +65,8 @@ public DataRow GetSingleRowUsing(IQuery query)
6265
6366 public IDataReader GetReaderUsing ( IQuery query )
6467 {
68+ Guard . AgainstNull ( query , nameof ( query ) ) ;
69+
6570 using ( var command = GuardedDatabaseContext ( ) . CreateCommandToExecute ( query ) )
6671 {
6772 if ( Log . IsTraceEnabled )
@@ -101,6 +106,8 @@ private static IDatabaseContext GuardedDatabaseContext()
101106
102107 public int ExecuteUsing ( IQuery query )
103108 {
109+ Guard . AgainstNull ( query , nameof ( query ) ) ;
110+
104111 using ( var command = GuardedDatabaseContext ( ) . CreateCommandToExecute ( query ) )
105112 {
106113 if ( Log . IsTraceEnabled )
@@ -128,6 +135,8 @@ public int ExecuteUsing(IQuery query)
128135
129136 public T GetScalarUsing < T > ( IQuery query )
130137 {
138+ Guard . AgainstNull ( query , nameof ( query ) ) ;
139+
131140 using ( var command = GuardedDatabaseContext ( ) . CreateCommandToExecute ( query ) )
132141 {
133142 if ( Log . IsTraceEnabled )
You can’t perform that action at this time.
0 commit comments