Skip to content

Commit 2f70d76

Browse files
Cleanup
1 parent 40b461e commit 2f70d76

5 files changed

Lines changed: 11 additions & 13 deletions

File tree

‎.editorconfig‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,3 +219,6 @@ dotnet_diagnostic.RCS1123.severity = silent
219219

220220
# IDE0028: Collection simplification
221221
dotnet_diagnostic.IDE0028.severity = silent
222+
223+
# IDE0008: var
224+
dotnet_diagnostic.IDE0008.severity = silent

‎Source/Core/Extensions/Command._.cs‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,7 @@ public static ValueTask<List<T>> ToListAsync<T>(this DbCommand command,
205205
CommandBehavior behavior,
206206
Func<IDataRecord, T> transform,
207207
CancellationToken cancellationToken = default)
208-
#pragma warning disable CS0618 // One obsolete overload forwards to another.
209208
=> ToListAsync(command, behavior, transform, true, cancellationToken);
210-
#pragma warning restore CS0618
211209

212210
/// <inheritdoc cref="ToListAsync{T}(DbCommand, CommandBehavior, Func{IDataRecord, T}, bool, CancellationToken)"/>
213211
[Obsolete(ToListAsyncObsolete)]
@@ -216,9 +214,7 @@ public static ValueTask<List<T>> ToListAsync<T>(this DbCommand command,
216214
CommandBehavior behavior = CommandBehavior.Default,
217215
bool useReadAsync = true,
218216
CancellationToken cancellationToken = default)
219-
#pragma warning disable CS0618 // One obsolete overload forwards to another.
220217
=> ToListAsync(command, behavior, transform, useReadAsync, cancellationToken);
221-
#pragma warning restore CS0618
222218

223219
/// <summary>
224220
/// Iterates all records using an <see cref="IDataReader"/> and returns the desired results as an array.

‎Tests/Open.Database.Extensions.Core.Tests/MappedViewParityTests.cs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,10 @@ public static void ANullReceiverOrSelector_Throws()
226226
Assert.Throws<ArgumentNullException>(() => reader!.Map(map));
227227
Assert.Throws<ArgumentNullException>(
228228
() => reader!.Map<Person>(new KeyValuePair<string, string?>("Id", "Id")));
229-
Assert.Throws<ArgumentNullException>(() => reader!.Map(r => 1));
229+
Assert.Throws<ArgumentNullException>(() => reader!.Map(_ => 1));
230230
Assert.Throws<ArgumentNullException>(() => command!.Map<Person>());
231231
Assert.Throws<ArgumentNullException>(() => command!.Map(map));
232-
Assert.Throws<ArgumentNullException>(() => command!.Map(r => 1));
232+
Assert.Throws<ArgumentNullException>(() => command!.Map(_ => 1));
233233
Assert.Throws<ArgumentNullException>(
234234
() => Reader(Rows(1)).Map((Func<IDataRecord, int>)null!));
235235
Assert.Throws<ArgumentNullException>(
@@ -264,10 +264,10 @@ static void FailsPlain(Func<ValueTask> use)
264264
Assert.Contains("Map<T>()", ex.Message);
265265
}
266266

267-
static ValueTask H1(IAsyncEnumerable<int> items, CancellationToken token)
267+
static ValueTask H1(IAsyncEnumerable<int> __, CancellationToken _)
268268
=> default;
269269

270-
static ValueTask<int> H2(IAsyncEnumerable<int> items, CancellationToken token)
270+
static ValueTask<int> H2(IAsyncEnumerable<int> __, CancellationToken _)
271271
=> new(0);
272272

273273
static void All<TQuery>(TQuery q, Action<TQuery> more)

‎Tests/Open.Database.Extensions.Core.Tests/RowMapConverterTests.cs‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Open.Database.Extensions.Core;
2-
using System.Data.Common;
32
using System.Globalization;
43

54
#nullable enable
@@ -661,7 +660,7 @@ static DataTable Table(params object?[][] rows)
661660
[Fact]
662661
public static async Task AReaderACommandAndATable_GiveTheSameRows()
663662
{
664-
using (TypedReader reader = TypedReader.Create(Columns, Valid()))
663+
await using (var reader = TypedReader.Create(Columns, Valid()))
665664
AssertFull(Assert.Single(reader.Map(Full).ToList()));
666665

667666
AssertFull(Assert.Single(Cmd(Columns, Valid()).Map(Full).ToList()));
@@ -693,9 +692,9 @@ static List<Order> Buffered(RowMap<Order> map, object?[] row)
693692
{
694693
string[] names = [.. Columns.Select(c => c.Name)];
695694
QueryResult<Queue<object[]>> result = new([.. Enumerable.Range(0, names.Length)], [.. names], new Queue<object[]>([row!]));
696-
#pragma warning disable CS0618 // Obsolete in 11.0, removed in 12: kept covered until then.
695+
#pragma warning disable CS0618 // Obsolete in 11.0, removed in 12: kept covered until then.
697696
return result.DequeueAs(map).ToList();
698-
#pragma warning restore CS0618
697+
#pragma warning restore CS0618
699698
}
700699

701700
[Fact]

‎Tests/Open.Database.Extensions.Core.Tests/SingleResultBeforeMapTests.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ public static async Task TheExpressiveView_AddsSingleResultToEveryExecution_AndF
693693
CommandBehavior.SingleResult | CommandBehavior.KeyInfo
694694
],
695695
command.Behaviors);
696-
Assert.Equal(Ct, command.ReaderTokens.Last());
696+
Assert.Equal(Ct, command.ReaderTokens[^1]);
697697
}
698698

699699
[Fact]

0 commit comments

Comments
 (0)