Skip to content

Commit 4904767

Browse files
Code Cleanup.
1 parent c7a16ba commit 4904767

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+57
-272
lines changed

Source/Channel/AsChannel.cs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
1-
using System;
2-
using System.Buffers;
3-
using System.Collections.Generic;
4-
using System.Data;
5-
using System.Data.Common;
6-
using System.Diagnostics.Contracts;
7-
using System.Threading;
8-
using System.Threading.Channels;
9-
10-
namespace Open.Database.Extensions;
1+
namespace Open.Database.Extensions;
112

123
[System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2012:Use ValueTasks correctly", Justification = "Intentionally running in the background.")]
134
[System.Diagnostics.CodeAnalysis.SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "<Pending>")]

Source/Channel/CreateChannel.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using System;
2-
using System.Diagnostics.Contracts;
3-
using System.Threading.Channels;
4-
5-
namespace Open.Database.Extensions;
1+
namespace Open.Database.Extensions;
62

73
public static partial class ChannelDbExtensions
84
{

Source/Channel/GlobalUsings.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
global using Open.ChannelExtensions;
2+
global using System;
3+
global using System.Buffers;
4+
global using System.Collections.Generic;
5+
global using System.Collections.Immutable;
6+
global using System.Data;
7+
global using System.Data.Common;
8+
global using System.Diagnostics.Contracts;
9+
global using System.Linq;
10+
global using System.Threading;
11+
global using System.Threading.Channels;
12+
global using System.Threading.Tasks;

Source/Channel/ToChannel.cs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
1-
using Open.ChannelExtensions;
2-
using System;
3-
using System.Buffers;
4-
using System.Collections.Generic;
5-
using System.Data;
6-
using System.Data.Common;
7-
using System.Diagnostics.Contracts;
8-
using System.Threading;
9-
using System.Threading.Channels;
10-
using System.Threading.Tasks;
11-
12-
namespace Open.Database.Extensions;
1+
namespace Open.Database.Extensions;
132

143
/// <summary>
154
/// Extensions for writing data to a channel.
@@ -149,7 +138,7 @@ public static async ValueTask<long> ToChannel(this IDbCommand command,
149138
{
150139
if (command is null) throw new ArgumentNullException(nameof(command));
151140
if (target is null) throw new ArgumentNullException(nameof(target));
152-
if(command.Connection is null) throw new InvalidOperationException("Command has no connection.");
141+
if (command.Connection is null) throw new InvalidOperationException("Command has no connection.");
153142
Contract.EndContractBlock();
154143

155144
if (!command.Connection.State.HasFlag(ConnectionState.Open))

Source/Channel/Transformer.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
1-
using Open.ChannelExtensions;
2-
using System;
3-
using System.Collections.Generic;
4-
using System.Collections.Immutable;
5-
using System.Data;
6-
using System.Data.Common;
7-
using System.Diagnostics.Contracts;
8-
using System.Linq;
9-
using System.Threading;
10-
using System.Threading.Channels;
11-
using System.Threading.Tasks;
12-
13-
namespace Open.Database.Extensions;
1+
namespace Open.Database.Extensions;
142

153
/// <summary>Constructs a <see cref="Transformer{T}"/>.</summary>
164
/// <param name="fieldMappingOverrides">An optional override map of field names to column names where the keys are the property names, and values are the column names.</param>

Source/Core/Core/DbConnectionProvider.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using System;
2-
using System.Data;
3-
using System.Diagnostics.Contracts;
4-
5-
namespace Open.Database.Extensions.Core;
1+
namespace Open.Database.Extensions.Core;
62

73
/// <summary>
84
/// Simplifies handling connections.

Source/Core/Core/QueryResult.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
using System;
2-
using System.Collections;
3-
using System.Collections.Generic;
4-
using System.Collections.Immutable;
5-
using System.Diagnostics.Contracts;
6-
using System.Linq;
7-
using System.Threading.Tasks;
1+
using System.Collections;
82

93
namespace Open.Database.Extensions.Core;
104

Source/Core/Core/Transformer.cs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
1-
using System;
2-
using System.Buffers;
3-
using System.Collections.Generic;
4-
using System.Collections.Immutable;
5-
using System.Data;
6-
using System.Data.Common;
7-
using System.Diagnostics.Contracts;
8-
using System.Linq;
9-
using System.Reflection;
1+
using System.Reflection;
102
using System.Runtime.CompilerServices;
11-
using System.Threading;
123

134
namespace Open.Database.Extensions.Core;
145

Source/Core/DbConnectionFactory.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using System;
2-
using System.Data;
3-
using System.Diagnostics.Contracts;
4-
5-
namespace Open.Database.Extensions;
1+
namespace Open.Database.Extensions;
62

73
/// <summary>
84
/// DbConnection factory implementation that accepts a factory function.

Source/Core/ExpressiveCommand.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using System.Collections.Generic;
2-
using System.Data;
3-
4-
namespace Open.Database.Extensions;
1+
namespace Open.Database.Extensions;
52

63
/// <summary>
74
/// An abstraction for executing commands on a database using best practices and simplified expressive syntax.

0 commit comments

Comments
 (0)