You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Updated solution file to include `Open.Database.Extensions.MSSqlClient` and `Source\Directory.Build.props`.
- Expanded `README.md` with a new "Principles" section and updated "Features" and "8.0 Release Notes".
- Added XML documentation comments to constructors in `ExpressiveCommand`, `ExpressiveCommandBase`, `ExpressiveDbCommand`, and `ExpressiveDbCommandBase` for improved clarity.
- Refactored connection management methods in `ConnectionProvider.Command.cs` to utilize the new `AsPool` method.
- Enhanced `Retrieve.cs` with a `SuppressMessage` attribute and improved handling of cancellation tokens in asynchronous methods.
- Added `using System.Data.Common` directive in `IDbConnectionFactory.cs` for better clarity.
- Updated `DbConnectionFactoryExtensions` to include new overloads for the `AsPool` method, enhancing flexibility in connection management.
Copy file name to clipboardExpand all lines: README.md
+22-9Lines changed: 22 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -4,24 +4,30 @@
4
4
5
5
Useful set of utilities and abstractions for simplifying modern database operations and ensuring dependency injection compatibility.
6
6
7
-
## Connection Factories
7
+
## Principles
8
+
9
+
- Minimize connection open time.
10
+
- Deferred/lazy transformation.
11
+
- Optimize for specific use cases.
12
+
- Minimize boilerplate code.
13
+
14
+
## Features
15
+
- Provides a fluent interface for database operations.
16
+
- Supports dependency injection for connection factories.
17
+
- Support both synchronous and asynchronous operations.
18
+
- Provides expressive commands for executing SQL queries and stored procedures.
19
+
20
+
### Connection Factories
8
21
9
22
Connection factories facilitate creation and disposal of connections without the concern of a connection reference or need for awareness of a connection string.
10
23
A `SqlConnectionFactory` is provided and can be overridden to provide more specific dependency injection configurations.
11
24
12
-
## Expressive Commands
25
+
###Expressive Commands
13
26
14
27
The provided expressive command classes allow for an expressive means to append parameters and execute the results without lengthy complicated setup.
15
28
16
29
Extensions are provided to create commands from connection factories.
17
30
18
-
## 8.0 Release Notes
19
-
20
-
- All `.ConfigureAwait(true)` are now `.ConfigureAwait(false)` as they should be. The caller will need to `.ConfigureAwait(true)` if they need to resume on the calling context.
21
-
- Added `Open.Database.Extensions.MSSqlClient` for `Microsoft.Data.SqlClient` support.
22
-
- .NET 8.0 added to targets to ensure potential compliation and performance improvements are available.
23
-
- Improved nullable integrity.
24
-
25
31
### Example
26
32
27
33
```cs
@@ -127,3 +133,10 @@ public static bool TryTransaction()
/// Creates an <see cref="ExpressiveCommand"/> with command type set to <see cref="CommandType.StoredProcedure"/> for subsequent configuration and execution.
@@ -216,7 +216,7 @@ public static ExpressiveDbCommand Command<TConnection>(
/// Creates an <see cref="ExpressiveDbCommand"/> with command type set to <see cref="CommandType.StoredProcedure"/> for subsequent configuration and execution.
@@ -228,5 +228,5 @@ public static ExpressiveDbCommand StoredProcedure<TConnection>(
@@ -141,12 +142,9 @@ public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(
141
142
CancellationTokencancellationToken)
142
143
=>RetrieveAsync(reader,true,cancellationToken);
143
144
144
-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design","CA1068:CancellationToken parameters must come last",Justification="Internal function that requires a cancellation token.")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design","CA1068:CancellationToken parameters must come last",Justification="Internal function that requires a cancellation token.")]
149
-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style","IDE0046:Convert to conditional expression",Justification="<Pending>")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design","CA1068:CancellationToken parameters must come last",Justification="Method takes params and cannot have a the cancellation token last.")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design","CA1068:CancellationToken parameters must come last",Justification="Method takes params and cannot have a the cancellation token last.")]
@@ -322,7 +318,6 @@ public static ValueTask<QueryResultQueue<object[]>> RetrieveAsync(
322
318
CancellationTokencancellationToken)
323
319
=>RetrieveAsync(command,true,cancellationToken);
324
320
325
-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design","CA1068:CancellationToken parameters must come last",Justification="Internal function that requires a cancellation token.")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design","CA1068:CancellationToken parameters must come last",Justification="Method takes params and cannot have a the cancellation token last.")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design","CA1068:CancellationToken parameters must come last",Justification="Method takes params and cannot have a the cancellation token last.")]
0 commit comments