Skip to content

Commit 4d5466e

Browse files
Code cleanup and spelling fixes.
1 parent 6c472af commit 4d5466e

29 files changed

+5738
-5739
lines changed

Source/Core/Constants.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
internal static class ConnectionTimeout
44
{
5-
public const ushort DEFAULT_SECONDS = 30;
5+
public const ushort DEFAULT_SECONDS = 30;
66
}
77

88
internal static class CommandTimeout
99
{
10-
public const ushort DEFAULT_SECONDS = 60;
10+
public const ushort DEFAULT_SECONDS = 60;
1111
}

Source/Core/Core/DbConnectionProvider.cs

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,48 @@ namespace Open.Database.Extensions.Core;
99
/// </summary>
1010
/// <typeparam name="TConnection"></typeparam>
1111
internal class DbConnectionProvider<TConnection> : IDbConnectionPool<TConnection>
12-
where TConnection : class, IDbConnection
12+
where TConnection : class, IDbConnection
1313
{
14-
public DbConnectionProvider(TConnection connection)
15-
{
16-
Connection = connection ?? throw new ArgumentNullException(nameof(connection));
17-
}
14+
public DbConnectionProvider(TConnection connection)
15+
{
16+
Connection = connection ?? throw new ArgumentNullException(nameof(connection));
17+
}
1818

19-
private TConnection Connection { get; }
19+
private TConnection Connection { get; }
2020

21-
private ConnectionState? TakenConnectionState;
21+
private ConnectionState? TakenConnectionState;
2222

23-
/// <inheritdoc />
24-
public TConnection Take()
25-
{
26-
if (TakenConnectionState.HasValue)
27-
throw new InvalidOperationException("Concurrent use of a single connection is not supported.");
23+
/// <inheritdoc />
24+
public TConnection Take()
25+
{
26+
if (TakenConnectionState.HasValue)
27+
throw new InvalidOperationException("Concurrent use of a single connection is not supported.");
2828

29-
TakenConnectionState = Connection.State;
30-
return Connection;
31-
}
29+
TakenConnectionState = Connection.State;
30+
return Connection;
31+
}
3232

33-
IDbConnection IDbConnectionPool.Take() => Take();
33+
IDbConnection IDbConnectionPool.Take() => Take();
3434

35-
/// <inheritdoc />
36-
public void Give(IDbConnection connection)
37-
{
38-
if (connection is null)
35+
/// <inheritdoc />
36+
public void Give(IDbConnection connection)
37+
{
38+
if (connection is null)
3939
throw new ArgumentNullException(nameof(connection));
40-
if (connection != Connection)
40+
if (connection != Connection)
4141
throw new ArgumentException("Does not belong to this provider.", nameof(connection));
42-
Contract.EndContractBlock();
42+
Contract.EndContractBlock();
4343

44-
if (TakenConnectionState == ConnectionState.Closed)
45-
connection.Close();
44+
if (TakenConnectionState == ConnectionState.Closed)
45+
connection.Close();
4646

47-
TakenConnectionState = null;
48-
}
47+
TakenConnectionState = null;
48+
}
4949
}
5050

5151
internal static class DbConnectionProvider
5252
{
53-
public static DbConnectionProvider<TConnection> Create<TConnection>(TConnection connection)
54-
where TConnection : class, IDbConnection
55-
=> new(connection);
53+
public static DbConnectionProvider<TConnection> Create<TConnection>(TConnection connection)
54+
where TConnection : class, IDbConnection
55+
=> new(connection);
5656
}

0 commit comments

Comments
 (0)