Skip to content

Commit 9757ed9

Browse files
committed
Change name of the result parameter
1 parent fd4d4be commit 9757ed9

10 files changed

+159
-159
lines changed

SqlMarshal.Tests/AsyncSqlConnectionTests.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ public partial async Task<int> M(int clientId, string? personId)
6969
var sqlQuery = @""sp_TestSP @client_id, @person_id"";
7070
command.CommandText = sqlQuery;
7171
command.Parameters.AddRange(parameters);
72-
var result = await command.ExecuteScalarAsync().ConfigureAwait(false);
73-
return (int)result!;
72+
var __result = await command.ExecuteScalarAsync().ConfigureAwait(false);
73+
return (int)__result!;
7474
}
7575
}
7676
}";
@@ -135,9 +135,9 @@ public partial async Task<int> M(int clientId, out int personId)
135135
var sqlQuery = @""sp_TestSP @client_id, @person_id OUTPUT"";
136136
command.CommandText = sqlQuery;
137137
command.Parameters.AddRange(parameters);
138-
var result = await command.ExecuteScalarAsync().ConfigureAwait(false);
138+
var __result = await command.ExecuteScalarAsync().ConfigureAwait(false);
139139
personId = (int)personIdParameter.Value;
140-
return (int)result!;
140+
return (int)__result!;
141141
}
142142
}
143143
}";
@@ -194,7 +194,7 @@ partial class C
194194
var sqlQuery = @""sp_TestSP"";
195195
command.CommandText = sqlQuery;
196196
using var reader = await command.ExecuteReaderAsync().ConfigureAwait(false);
197-
var result = new List<Item>();
197+
var __result = new List<Item>();
198198
while (await reader.ReadAsync().ConfigureAwait(false))
199199
{
200200
var item = new Item();
@@ -204,11 +204,11 @@ partial class C
204204
item.Int32Value = (int)value_1;
205205
var value_2 = reader.GetValue(2);
206206
item.NullableInt32Value = value_2 == DBNull.Value ? (int?)null : (int)value_2;
207-
result.Add(item);
207+
__result.Add(item);
208208
}
209209
210210
await reader.CloseAsync().ConfigureAwait(false);
211-
return result;
211+
return __result;
212212
}
213213
}
214214
}";
@@ -255,14 +255,14 @@ partial class C
255255
using var command = connection.CreateCommand();
256256
257257
var sqlQuery = @""sp_TestSP"";
258-
Item result = null!;
258+
Item __result = null!;
259259
var asyncEnumerable = this.dbContext.Items.FromSqlRaw(sqlQuery).AsAsyncEnumerable();
260260
await foreach (var current in asyncEnumerable)
261261
{
262-
result = current;
262+
__result = current;
263263
break;
264264
}
265-
return result;
265+
return __result;
266266
}
267267
}
268268
}";
@@ -324,15 +324,15 @@ partial class C
324324
return null;
325325
}
326326
327-
var result = new Item();
327+
var __result = new Item();
328328
var value_0 = reader.GetValue(0);
329-
result.StringValue = value_0 == DBNull.Value ? (string?)null : (string)value_0;
329+
__result.StringValue = value_0 == DBNull.Value ? (string?)null : (string)value_0;
330330
var value_1 = reader.GetValue(1);
331-
result.Int32Value = (int)value_1;
331+
__result.Int32Value = (int)value_1;
332332
var value_2 = reader.GetValue(2);
333-
result.NullableInt32Value = value_2 == DBNull.Value ? (int?)null : (int)value_2;
333+
__result.NullableInt32Value = value_2 == DBNull.Value ? (int?)null : (int)value_2;
334334
await reader.CloseAsync().ConfigureAwait(false);
335-
return result;
335+
return __result;
336336
}
337337
}
338338
}";
@@ -394,9 +394,9 @@ public partial async Task<IList<Item>> M(int clientId, out int? personId)
394394
};
395395
396396
var sqlQuery = @""sp_TestSP @client_id, @person_id OUTPUT"";
397-
var result = await this.dbContext.Items.FromSqlRaw(sqlQuery, parameters).ToListAsync().ConfigureAwait(false);
397+
var __result = await this.dbContext.Items.FromSqlRaw(sqlQuery, parameters).ToListAsync().ConfigureAwait(false);
398398
personId = personIdParameter.Value == DBNull.Value ? (int?)null : (int)personIdParameter.Value;
399-
return result;
399+
return __result;
400400
}
401401
}
402402
}";

SqlMarshal.Tests/CancellationTokenTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ public partial async Task<int> M(int clientId, string? personId, System.Threadin
7171
var sqlQuery = @""sp_TestSP @client_id, @person_id"";
7272
command.CommandText = sqlQuery;
7373
command.Parameters.AddRange(parameters);
74-
var result = await command.ExecuteScalarAsync(cancellationToken).ConfigureAwait(false);
75-
return (int)result!;
74+
var __result = await command.ExecuteScalarAsync(cancellationToken).ConfigureAwait(false);
75+
return (int)__result!;
7676
}
7777
}
7878
}";
@@ -193,7 +193,7 @@ partial class C
193193
var sqlQuery = @""sp_TestSP"";
194194
command.CommandText = sqlQuery;
195195
using var reader = await command.ExecuteReaderAsync(cancellationToken).ConfigureAwait(false);
196-
var result = new List<Item>();
196+
var __result = new List<Item>();
197197
while (await reader.ReadAsync(cancellationToken).ConfigureAwait(false))
198198
{
199199
var item = new Item();
@@ -203,11 +203,11 @@ partial class C
203203
item.Int32Value = (int)value_1;
204204
var value_2 = reader.GetValue(2);
205205
item.NullableInt32Value = value_2 == DBNull.Value ? (int?)null : (int)value_2;
206-
result.Add(item);
206+
__result.Add(item);
207207
}
208208
209209
await reader.CloseAsync().ConfigureAwait(false);
210-
return result;
210+
return __result;
211211
}
212212
}
213213
}";
@@ -269,9 +269,9 @@ public partial async Task<IList<Item>> M(int clientId, out int? personId, Cancel
269269
};
270270
271271
var sqlQuery = @""sp_TestSP @client_id, @person_id OUTPUT"";
272-
var result = await this.dbContext.Items.FromSqlRaw(sqlQuery, parameters).ToListAsync(cancellationToken).ConfigureAwait(false);
272+
var __result = await this.dbContext.Items.FromSqlRaw(sqlQuery, parameters).ToListAsync(cancellationToken).ConfigureAwait(false);
273273
personId = personIdParameter.Value == DBNull.Value ? (int?)null : (int)personIdParameter.Value;
274-
return result;
274+
return __result;
275275
}
276276
}
277277
}";

SqlMarshal.Tests/CrudGenerationTests.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,19 @@ partial class C
6363
var sqlQuery = @""SELECT id, name FROM test_entity"";
6464
command.CommandText = sqlQuery;
6565
using var reader = command.ExecuteReader();
66-
var result = new List<TestEntity>();
66+
var __result = new List<TestEntity>();
6767
while (reader.Read())
6868
{
6969
var item = new TestEntity();
7070
var value_0 = reader.GetValue(0);
7171
item.Id = (int)value_0;
7272
var value_1 = reader.GetValue(1);
7373
item.Name = value_1 == DBNull.Value ? (string?)null : (string)value_1;
74-
result.Add(item);
74+
__result.Add(item);
7575
}
7676
7777
reader.Close();
78-
return result;
78+
return __result;
7979
}
8080
}
8181
}";
@@ -148,13 +148,13 @@ partial class C
148148
return null;
149149
}
150150
151-
var result = new TestEntity();
151+
var __result = new TestEntity();
152152
var value_0 = reader.GetValue(0);
153-
result.Id = (int)value_0;
153+
__result.Id = (int)value_0;
154154
var value_1 = reader.GetValue(1);
155-
result.Name = value_1 == DBNull.Value ? (string?)null : (string)value_1;
155+
__result.Name = value_1 == DBNull.Value ? (string?)null : (string)value_1;
156156
reader.Close();
157-
return result;
157+
return __result;
158158
}
159159
}
160160
}";
@@ -211,8 +211,8 @@ public partial int Count()
211211
212212
var sqlQuery = @""SELECT COUNT(1) FROM test_entity"";
213213
command.CommandText = sqlQuery;
214-
var result = command.ExecuteScalar();
215-
return (int)result!;
214+
var __result = command.ExecuteScalar();
215+
return (int)__result!;
216216
}
217217
}
218218
}";

SqlMarshal.Tests/CustomSqlTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ public partial int M(string sql, int clientId, string? personId)
6868
6969
command.CommandText = sql;
7070
command.Parameters.AddRange(parameters);
71-
var result = command.ExecuteScalar();
72-
return (int)result!;
71+
var __result = command.ExecuteScalar();
72+
return (int)__result!;
7373
}
7474
}
7575
}";
@@ -125,7 +125,7 @@ partial class C
125125
126126
command.CommandText = sql;
127127
using var reader = command.ExecuteReader();
128-
var result = new List<Item>();
128+
var __result = new List<Item>();
129129
while (reader.Read())
130130
{
131131
var item = new Item();
@@ -135,11 +135,11 @@ partial class C
135135
item.Int32Value = (int)value_1;
136136
var value_2 = reader.GetValue(2);
137137
item.NullableInt32Value = value_2 == DBNull.Value ? (int?)null : (int)value_2;
138-
result.Add(item);
138+
__result.Add(item);
139139
}
140140
141141
reader.Close();
142-
return result;
142+
return __result;
143143
}
144144
}
145145
}";

SqlMarshal.Tests/DbDataReaderTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ public partial System.Data.Common.DbDataReader M(int clientId, string? personId)
6969
var sqlQuery = @""sp_TestSP @client_id, @person_id"";
7070
command.CommandText = sqlQuery;
7171
command.Parameters.AddRange(parameters);
72-
var result = command.ExecuteReader();
73-
return result;
72+
var __result = command.ExecuteReader();
73+
return __result;
7474
}
7575
}
7676
}";

SqlMarshal.Tests/ExtensionMethodTests.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ public static partial async Task<int> M(this DbConnection connection, int client
6767
var sqlQuery = @""sp_TestSP @client_id, @person_id"";
6868
command.CommandText = sqlQuery;
6969
command.Parameters.AddRange(parameters);
70-
var result = await command.ExecuteScalarAsync().ConfigureAwait(false);
71-
return (int)result!;
70+
var __result = await command.ExecuteScalarAsync().ConfigureAwait(false);
71+
return (int)__result!;
7272
}
7373
}
7474
}";
@@ -130,8 +130,8 @@ public static partial async Task<int> M(DbConnection connection, int clientId, s
130130
var sqlQuery = @""sp_TestSP @client_id, @person_id"";
131131
command.CommandText = sqlQuery;
132132
command.Parameters.AddRange(parameters);
133-
var result = await command.ExecuteScalarAsync().ConfigureAwait(false);
134-
return (int)result!;
133+
var __result = await command.ExecuteScalarAsync().ConfigureAwait(false);
134+
return (int)__result!;
135135
}
136136
}
137137
}";
@@ -193,8 +193,8 @@ public static partial async Task<int> M(DbConnection conn, int clientId, string?
193193
var sqlQuery = @""sp_TestSP @client_id, @person_id"";
194194
command.CommandText = sqlQuery;
195195
command.Parameters.AddRange(parameters);
196-
var result = await command.ExecuteScalarAsync().ConfigureAwait(false);
197-
return (int)result!;
196+
var __result = await command.ExecuteScalarAsync().ConfigureAwait(false);
197+
return (int)__result!;
198198
}
199199
}
200200
}";
@@ -249,7 +249,7 @@ partial class C
249249
var sqlQuery = @""sp_TestSP"";
250250
command.CommandText = sqlQuery;
251251
using var reader = await command.ExecuteReaderAsync().ConfigureAwait(false);
252-
var result = new List<Item>();
252+
var __result = new List<Item>();
253253
while (await reader.ReadAsync().ConfigureAwait(false))
254254
{
255255
var item = new Item();
@@ -259,11 +259,11 @@ partial class C
259259
item.Int32Value = (int)value_1;
260260
var value_2 = reader.GetValue(2);
261261
item.NullableInt32Value = value_2 == DBNull.Value ? (int?)null : (int)value_2;
262-
result.Add(item);
262+
__result.Add(item);
263263
}
264264
265265
await reader.CloseAsync().ConfigureAwait(false);
266-
return result;
266+
return __result;
267267
}
268268
}
269269
}";
@@ -336,8 +336,8 @@ public static partial int M(this Foo.CustomDbContext context, int clientId, stri
336336
context.Database.OpenConnection();
337337
try
338338
{
339-
var result = command.ExecuteScalar();
340-
return (int)result!;
339+
var __result = command.ExecuteScalar();
340+
return (int)__result!;
341341
}
342342
finally
343343
{

SqlMarshal.Tests/JoinTransactionTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ public partial int M(DbTransaction transaction, int clientId, string? personId)
7070
command.CommandText = sqlQuery;
7171
command.Parameters.AddRange(parameters);
7272
command.Transaction = transaction;
73-
var result = command.ExecuteScalar();
74-
return (int)result!;
73+
var __result = command.ExecuteScalar();
74+
return (int)__result!;
7575
}
7676
}
7777
}";
@@ -119,8 +119,8 @@ public partial IList<Item> M(DbTransaction transaction)
119119
120120
var sqlQuery = @""sp_TestSP"";
121121
this.dbContext.Database.UseTransaction(transaction);
122-
var result = this.dbContext.Items.FromSqlRaw(sqlQuery).ToList();
123-
return result;
122+
var __result = this.dbContext.Items.FromSqlRaw(sqlQuery).ToList();
123+
return __result;
124124
}
125125
}
126126
}";

0 commit comments

Comments
 (0)