Skip to content

Commit 5e6af2b

Browse files
committed
Fix async ambiguous methods
1 parent 5780b2b commit 5e6af2b

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

src/NHibernate/Async/Tool/hbm2ddl/SchemaExport.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public partial class SchemaExport
7171
return CreateAsync(useStdOut, execute, null, cancellationToken);
7272
}
7373

74+
//TODO 6.0: Make connection parameter optional: DbConnection connection = null
7475
/// <summary>
7576
/// Run the schema creation script
7677
/// </summary>
@@ -83,7 +84,7 @@ public partial class SchemaExport
8384
/// This is a convenience method that calls <see cref="ExecuteAsync(bool, bool, bool,CancellationToken)"/> and sets
8485
/// the justDrop parameter to false.
8586
/// </remarks>
86-
public Task CreateAsync(bool useStdOut, bool execute, DbConnection connection = null, CancellationToken cancellationToken = default(CancellationToken))
87+
public Task CreateAsync(bool useStdOut, bool execute, DbConnection connection, CancellationToken cancellationToken = default(CancellationToken))
8788
{
8889
if (cancellationToken.IsCancellationRequested)
8990
{
@@ -119,6 +120,7 @@ public partial class SchemaExport
119120
return CreateAsync(scriptAction, execute, null, cancellationToken);
120121
}
121122

123+
//TODO 6.0: Make connection parameter optional: DbConnection connection = null
122124
/// <summary>
123125
/// Run the schema creation script
124126
/// </summary>
@@ -131,7 +133,7 @@ public partial class SchemaExport
131133
/// This is a convenience method that calls <see cref="ExecuteAsync(bool, bool, bool,CancellationToken)"/> and sets
132134
/// the justDrop parameter to false.
133135
/// </remarks>
134-
public Task CreateAsync(Action<string> scriptAction, bool execute, DbConnection connection = null, CancellationToken cancellationToken = default(CancellationToken))
136+
public Task CreateAsync(Action<string> scriptAction, bool execute, DbConnection connection, CancellationToken cancellationToken = default(CancellationToken))
135137
{
136138
if (cancellationToken.IsCancellationRequested)
137139
{
@@ -160,6 +162,7 @@ public partial class SchemaExport
160162
return CreateAsync(exportOutput, execute, null, cancellationToken);
161163
}
162164

165+
//TODO 6.0: Make connection parameter optional: DbConnection connection = null
163166
/// <summary>
164167
/// Run the schema creation script
165168
/// </summary>
@@ -172,7 +175,7 @@ public partial class SchemaExport
172175
/// This is a convenience method that calls <see cref="ExecuteAsync(bool, bool, bool,CancellationToken)"/> and sets
173176
/// the justDrop parameter to false.
174177
/// </remarks>
175-
public Task CreateAsync(TextWriter exportOutput, bool execute, DbConnection connection = null, CancellationToken cancellationToken = default(CancellationToken))
178+
public Task CreateAsync(TextWriter exportOutput, bool execute, DbConnection connection, CancellationToken cancellationToken = default(CancellationToken))
176179
{
177180
if (cancellationToken.IsCancellationRequested)
178181
{
@@ -201,6 +204,7 @@ public partial class SchemaExport
201204
return DropAsync(useStdOut, execute, null, cancellationToken);
202205
}
203206

207+
//TODO 6.0: Make connection parameter optional: DbConnection connection = null
204208
/// <summary>
205209
/// Run the drop schema script
206210
/// </summary>
@@ -213,7 +217,7 @@ public partial class SchemaExport
213217
/// This is a convenience method that calls <see cref="ExecuteAsync(bool, bool, bool,CancellationToken)"/> and sets
214218
/// the justDrop parameter to true.
215219
/// </remarks>
216-
public Task DropAsync(bool useStdOut, bool execute, DbConnection connection = null, CancellationToken cancellationToken = default(CancellationToken))
220+
public Task DropAsync(bool useStdOut, bool execute, DbConnection connection, CancellationToken cancellationToken = default(CancellationToken))
217221
{
218222
if (cancellationToken.IsCancellationRequested)
219223
{
@@ -249,6 +253,7 @@ public partial class SchemaExport
249253
return DropAsync(exportOutput, execute, null, cancellationToken);
250254
}
251255

256+
//TODO 6.0: Make connection parameter optional: DbConnection connection = null
252257
/// <summary>
253258
/// Run the drop schema script
254259
/// </summary>
@@ -261,7 +266,7 @@ public partial class SchemaExport
261266
/// This is a convenience method that calls <see cref="ExecuteAsync(Action&lt;string&gt;, bool, bool, TextWriter,CancellationToken)"/> and sets
262267
/// the justDrop parameter to true.
263268
/// </remarks>
264-
public Task DropAsync(TextWriter exportOutput, bool execute, DbConnection connection = null, CancellationToken cancellationToken = default(CancellationToken))
269+
public Task DropAsync(TextWriter exportOutput, bool execute, DbConnection connection, CancellationToken cancellationToken = default(CancellationToken))
265270
{
266271
if (cancellationToken.IsCancellationRequested)
267272
{

src/NHibernate/Tool/hbm2ddl/SchemaExport.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ public void Create(bool useStdOut, bool execute)
111111
Create(useStdOut, execute, null);
112112
}
113113

114+
//TODO 6.0: Make connection parameter optional: DbConnection connection = null
114115
/// <summary>
115116
/// Run the schema creation script
116117
/// </summary>
@@ -122,7 +123,7 @@ public void Create(bool useStdOut, bool execute)
122123
/// This is a convenience method that calls <see cref="Execute(bool, bool, bool)"/> and sets
123124
/// the justDrop parameter to false.
124125
/// </remarks>
125-
public void Create(bool useStdOut, bool execute, DbConnection connection = null)
126+
public void Create(bool useStdOut, bool execute, DbConnection connection)
126127
{
127128
InitConnectionAndExecute(GetAction(useStdOut), execute, false, connection, null);
128129
}
@@ -142,6 +143,7 @@ public void Create(Action<string> scriptAction, bool execute)
142143
Create(scriptAction, execute, null);
143144
}
144145

146+
//TODO 6.0: Make connection parameter optional: DbConnection connection = null
145147
/// <summary>
146148
/// Run the schema creation script
147149
/// </summary>
@@ -153,7 +155,7 @@ public void Create(Action<string> scriptAction, bool execute)
153155
/// This is a convenience method that calls <see cref="Execute(bool, bool, bool)"/> and sets
154156
/// the justDrop parameter to false.
155157
/// </remarks>
156-
public void Create(Action<string> scriptAction, bool execute, DbConnection connection = null)
158+
public void Create(Action<string> scriptAction, bool execute, DbConnection connection)
157159
{
158160
InitConnectionAndExecute(scriptAction, execute, false, connection, null);
159161
}
@@ -173,6 +175,7 @@ public void Create(TextWriter exportOutput, bool execute)
173175
Create(exportOutput, execute, null);
174176
}
175177

178+
//TODO 6.0: Make connection parameter optional: DbConnection connection = null
176179
/// <summary>
177180
/// Run the schema creation script
178181
/// </summary>
@@ -184,7 +187,7 @@ public void Create(TextWriter exportOutput, bool execute)
184187
/// This is a convenience method that calls <see cref="Execute(bool, bool, bool)"/> and sets
185188
/// the justDrop parameter to false.
186189
/// </remarks>
187-
public void Create(TextWriter exportOutput, bool execute, DbConnection connection = null)
190+
public void Create(TextWriter exportOutput, bool execute, DbConnection connection)
188191
{
189192
InitConnectionAndExecute(null, execute, false, connection, exportOutput);
190193
}
@@ -204,6 +207,7 @@ public void Drop(bool useStdOut, bool execute)
204207
Drop(useStdOut, execute, null);
205208
}
206209

210+
//TODO 6.0: Make connection parameter optional: DbConnection connection = null
207211
/// <summary>
208212
/// Run the drop schema script
209213
/// </summary>
@@ -215,7 +219,7 @@ public void Drop(bool useStdOut, bool execute)
215219
/// This is a convenience method that calls <see cref="Execute(bool, bool, bool)"/> and sets
216220
/// the justDrop parameter to true.
217221
/// </remarks>
218-
public void Drop(bool useStdOut, bool execute, DbConnection connection = null)
222+
public void Drop(bool useStdOut, bool execute, DbConnection connection)
219223
{
220224
InitConnectionAndExecute(GetAction(useStdOut), execute, true, connection, null);
221225
}
@@ -235,6 +239,7 @@ public void Drop(TextWriter exportOutput, bool execute)
235239
Drop(exportOutput, execute, null);
236240
}
237241

242+
//TODO 6.0: Make connection parameter optional: DbConnection connection = null
238243
/// <summary>
239244
/// Run the drop schema script
240245
/// </summary>
@@ -246,7 +251,7 @@ public void Drop(TextWriter exportOutput, bool execute)
246251
/// This is a convenience method that calls <see cref="Execute(Action&lt;string&gt;, bool, bool, TextWriter)"/> and sets
247252
/// the justDrop parameter to true.
248253
/// </remarks>
249-
public void Drop(TextWriter exportOutput, bool execute, DbConnection connection = null)
254+
public void Drop(TextWriter exportOutput, bool execute, DbConnection connection)
250255
{
251256
InitConnectionAndExecute(null, execute, true, connection, exportOutput);
252257
}

0 commit comments

Comments
 (0)