├── Key.snk
├── .github
├── FUNDING.yml
└── ISSUE_TEMPLATE.md
├── dapper-plus-sponsor.png
├── entity-framework-extensions-sponsor.png
├── Dapper.Transaction.Net461
├── packages.config
├── Properties
│ └── AssemblyInfo.cs
└── Dapper.Transaction.Net461.csproj
├── Dapper.Transaction.StrongName.Net461
├── packages.config
├── Properties
│ └── AssemblyInfo.cs
└── Dapper.Transaction.StrongName.Net461.csproj
├── Lab
├── App.config
├── packages.config
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
└── Lab.csproj
├── Lab.StrongName
├── App.config
├── packages.config
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
└── Lab.StrongName.csproj
├── Dapper.Transaction.Shared
├── Helper
│ └── GetConnection.cs
├── Dapper.Transaction.Shared.shproj
├── DbTransaction
│ └── Extensions
│ │ ├── QueryUnbufferedAsync.cs
│ │ ├── Execute.cs
│ │ ├── QueryMultiple.cs
│ │ ├── ExecuteScalar.cs
│ │ ├── ExecuteAsync.cs
│ │ ├── QueryMultipleAsync.cs
│ │ ├── ExecuteScalarAsync.cs
│ │ ├── ExecuteScalar`.cs
│ │ ├── QueryUnbufferedAsync`.cs
│ │ ├── ExecuteScalarAsync`.cs
│ │ ├── QuerySingle`.cs
│ │ ├── QueryFirst`.cs
│ │ ├── QueryFirstOrDefault`.cs
│ │ ├── QuerySingleOrDefault`.cs
│ │ ├── QueryFirstAsync`.cs
│ │ ├── QuerySingleAsync`.cs
│ │ ├── QueryFirstOrDefaultAsync`.cs
│ │ ├── QuerySingleOrDefaultAsync`.cs
│ │ ├── QueryFirst.cs
│ │ ├── QuerySingle.cs
│ │ ├── QueryFirstOrDefault.cs
│ │ ├── QuerySingleOrDefault.cs
│ │ ├── Query.cs
│ │ ├── QueryFirstAsync.cs
│ │ ├── QuerySingleAsync.cs
│ │ ├── QueryFirstOrDefaultAsync.cs
│ │ ├── QuerySingleOrDefaultAsync.cs
│ │ ├── QueryAsync.cs
│ │ ├── ExecuteReader.cs
│ │ ├── ExecuteReaderAsync.cs
│ │ ├── Query`.cs
│ │ └── QueryAsync`.cs
└── Dapper.Transaction.Shared.projitems
├── Dapper.Transaction.Net5
└── Dapper.Transaction.Net5.csproj
├── Dapper.Transaction.Net7
└── Dapper.Transaction.Net7.csproj
├── LICENSE
├── Dapper.Transaction.StrongName.Net5
└── Dapper.Transaction.StrongName.Net5.csproj
├── Dapper.Transaction.StrongName.Net7
└── Dapper.Transaction.StrongName.Net7.csproj
├── Dapper.Transaction.NetStandard20
└── Dapper.Transaction.NetStandard20.csproj
├── Dapper.Transaction.StrongName.NetStandard20
└── Dapper.Transaction.StrongName.NetStandard20.csproj
├── .gitignore
├── README.md
└── Dapper.Transaction.sln
/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/Dapper.Transaction/HEAD/Key.snk
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: [zzzprojects]
2 | custom: ["https://zzzprojects.com/contribute"]
3 |
--------------------------------------------------------------------------------
/dapper-plus-sponsor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/Dapper.Transaction/HEAD/dapper-plus-sponsor.png
--------------------------------------------------------------------------------
/entity-framework-extensions-sponsor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzzprojects/Dapper.Transaction/HEAD/entity-framework-extensions-sponsor.png
--------------------------------------------------------------------------------
/Dapper.Transaction.Net461/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Dapper.Transaction.StrongName.Net461/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Lab/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Lab.StrongName/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Lab/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Lab.StrongName/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Dapper.Transaction.Shared/Helper/GetConnection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Data;
3 | using System.Data.Common;
4 |
5 | namespace Dapper.Transaction
6 | {
7 | internal class InternalGetConnection
8 | {
9 | public static IDbConnection GetConnection(IDbTransaction transaction)
10 | {
11 | if (transaction.Connection == null)
12 | {
13 | throw new Exception("Oops! No connection has been found for the transaction.");
14 | }
15 |
16 | return transaction.Connection;
17 | }
18 |
19 | public static DbConnection GetConnection(DbTransaction transaction)
20 | {
21 | if (transaction.Connection == null)
22 | {
23 | throw new Exception("Oops! No connection has been found for the transaction.");
24 | }
25 |
26 | return transaction.Connection;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Dapper.Transaction.Net461/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | [assembly: AssemblyTitle("Dapper.Transaction")]
5 | [assembly: AssemblyDescription("IDbTransaction extension methods for Dapper: A high performance Micro-ORM supporting SQL Server, MySQL, Sqlite, SqlCE, Firebird etc..")]
6 | [assembly: AssemblyConfiguration("")]
7 | [assembly: AssemblyCompany("ZZZ Projects Inc.")]
8 | [assembly: AssemblyProduct("Dapper.Transaction")]
9 | [assembly: AssemblyCopyright("ZZZ Projects Inc.")]
10 | [assembly: AssemblyTrademark("")]
11 | [assembly: AssemblyCulture("")]
12 | [assembly: ComVisible(false)]
13 | [assembly: Guid("b95951e5-7167-4b34-9cf0-d33ac6178333")]
14 |
15 | [assembly: AssemblyVersion("2.1.35.0")]
16 | [assembly: AssemblyFileVersion("2.1.35.0")]
17 |
--------------------------------------------------------------------------------
/Dapper.Transaction.StrongName.Net461/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | [assembly: AssemblyTitle("Dapper.Transaction")]
5 | [assembly: AssemblyDescription("IDbTransaction extension methods for Dapper: A high performance Micro-ORM supporting SQL Server, MySQL, Sqlite, SqlCE, Firebird etc..")]
6 | [assembly: AssemblyConfiguration("")]
7 | [assembly: AssemblyCompany("ZZZ Projects Inc.")]
8 | [assembly: AssemblyProduct("Dapper.Transaction")]
9 | [assembly: AssemblyCopyright("ZZZ Projects Inc.")]
10 | [assembly: AssemblyTrademark("")]
11 | [assembly: AssemblyCulture("")]
12 | [assembly: ComVisible(false)]
13 | [assembly: Guid("b95951e5-7167-4b34-9cf0-d33ac6178333")]
14 |
15 | [assembly: AssemblyVersion("2.1.35.0")]
16 | [assembly: AssemblyFileVersion("2.1.35.0")]
--------------------------------------------------------------------------------
/Dapper.Transaction.Net5/Dapper.Transaction.Net5.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net5.0
5 | Dapper.Transaction
6 | Dapper.Transaction
7 | 2.1.35
8 | ZZZ Projects Inc.
9 | ZZZ Projects Inc.
10 | ZZZ Projects Inc.
11 |
12 |
13 |
14 | bin\Release\
15 | bin\Release\Dapper.Transaction.xml
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Dapper.Transaction.Net7/Dapper.Transaction.Net7.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net7.0
5 | Dapper.Transaction
6 | Dapper.Transaction
7 | 2.1.35
8 | ZZZ Projects Inc.
9 | ZZZ Projects Inc.
10 | ZZZ Projects Inc.
11 |
12 |
13 |
14 | bin\Release\
15 | bin\Release\Dapper.Transaction.xml
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Lab/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data.SqlClient;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using Dapper;
8 | using Dapper.Transaction;
9 |
10 | namespace Lab
11 | {
12 | class Program
13 | {
14 | static void Main(string[] args)
15 | {
16 | using (var connection = new SqlConnection("Server=localhost;Initial Catalog=Z.Dapper.Plus.Lab;Integrated Security=True;"))
17 | {
18 | var x1 = connection.ExecuteScalar("SELECT 1");
19 | }
20 |
21 | using (var connection = new SqlConnection("Server=localhost;Initial Catalog=Z.Dapper.Plus.Lab;Integrated Security=True;"))
22 | {
23 | connection.Open();
24 | var trans = connection.BeginTransaction();
25 | var x1 = trans.ExecuteScalar("SELECT 1");
26 | }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Lab.StrongName/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data.SqlClient;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using Dapper;
8 | using Dapper.Transaction;
9 |
10 | namespace Lab.StrongName
11 | {
12 | class Program
13 | {
14 | static void Main(string[] args)
15 | {
16 | using (var connection = new SqlConnection("Server=localhost;Initial Catalog=Z.Dapper.Plus.Lab;Integrated Security=True;"))
17 | {
18 | var x1 = connection.ExecuteScalar("SELECT 1");
19 | }
20 |
21 | using (var connection = new SqlConnection("Server=localhost;Initial Catalog=Z.Dapper.Plus.Lab;Integrated Security=True;"))
22 | {
23 | connection.Open();
24 | var trans = connection.BeginTransaction();
25 | var x1 = trans.ExecuteScalar("SELECT 1");
26 | }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | Here is what to include in your request to make sure we implement a solution as quickly as possible.
2 |
3 | ## 1. Description
4 | Describe the issue or propose a feature.
5 |
6 | ## 2. Exception
7 | If you are seeing an exception, include the full exception details (message and stack trace).
8 |
9 | ```
10 | Exception message:
11 | Stack trace:
12 | ```
13 |
14 | ## 3. Fiddle or Project
15 | If you are able,
16 |
17 | Provide a Fiddle that reproduce the issue: https://dotnetfiddle.net/25Vjsn
18 |
19 | Or provide a project/solution that we can run to reproduce the issue.
20 | - Make sure the project compile
21 | - Make sure to provide only the code that is required to reproduce the issue, not the whole project
22 | - You can send private code here: info@zzzprojects.com
23 |
24 | Otherwise, make sure to include as much information as possible to help our team to reproduce the issue.
25 |
26 | ## 4. Any further technical details
27 | Add any relevant detail that can help us.
28 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 | Permission is hereby granted, free of charge, to any person obtaining a copy
3 | of this software and associated documentation files (the "Software"), to deal
4 | in the Software without restriction, including without limitation the rights
5 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
6 | copies of the Software, and to permit persons to whom the Software is
7 | furnished to do so, subject to the following conditions:
8 |
9 | The above copyright notice and this permission notice shall be included in all
10 | copies or substantial portions of the Software.
11 |
12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18 | SOFTWARE.
19 |
--------------------------------------------------------------------------------
/Dapper.Transaction.StrongName.Net5/Dapper.Transaction.StrongName.Net5.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net5.0
5 | true
6 | ..\Key.snk
7 | Dapper.Transaction.StrongName
8 | Dapper.Transaction
9 | 2.1.35
10 | ZZZ Projects Inc.
11 | ZZZ Projects Inc.
12 | ZZZ Projects Inc.
13 |
14 |
15 |
16 | bin\Release\
17 | bin\Release\Dapper.Transaction.StrongName.xml
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Dapper.Transaction.StrongName.Net7/Dapper.Transaction.StrongName.Net7.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net7.0
5 | true
6 | ..\Key.snk
7 | Dapper.Transaction.StrongName
8 | Dapper.Transaction
9 | 2.1.35
10 | ZZZ Projects Inc.
11 | ZZZ Projects Inc.
12 | ZZZ Projects Inc.
13 |
14 |
15 |
16 | bin\Release\
17 | bin\Release\Dapper.Transaction.StrongName.xml
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Dapper.Transaction.Shared/Dapper.Transaction.Shared.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | f448faea-4a1d-4432-8343-99c346856dab
5 | 14.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Dapper.Transaction.NetStandard20/Dapper.Transaction.NetStandard20.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | false
6 | ..\Key.snk
7 | 2.1.35
8 | Dapper.Transaction
9 | ZZZ Projects Inc.
10 | ZZZ Projects Inc.
11 | Dapper.Transaction
12 | Dapper.Transaction
13 | IDbTransaction extension methods for Dapper: A high performance Micro-ORM supporting SQL Server, MySQL, Sqlite, SqlCE, Firebird etc..
14 | ZZZ Projects Inc.
15 |
16 |
17 |
18 | \bin\Release\netstandard2.0\Dapper.Transaction.xml
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Dapper.Transaction.StrongName.NetStandard20/Dapper.Transaction.StrongName.NetStandard20.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | true
6 | ..\Key.snk
7 | 2.1.35
8 | Dapper.Transaction
9 | ZZZ Projects Inc.
10 | ZZZ Projects Inc.
11 | Dapper.Transaction.StrongName
12 | Dapper.Transaction
13 | IDbTransaction extension methods for Dapper: A high performance Micro-ORM supporting SQL Server, MySQL, Sqlite, SqlCE, Firebird etc..
14 | ZZZ Projects Inc.
15 |
16 |
17 |
18 | \bin\Release\netstandard2.0\Dapper.Transaction.StrongName.xml
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Dapper.Transaction.Shared/DbTransaction/Extensions/QueryUnbufferedAsync.cs:
--------------------------------------------------------------------------------
1 | #if NET5_0_OR_GREATER
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Data;
5 | using System.Data.Common;
6 |
7 | namespace Dapper.Transaction
8 | {
9 | public static partial class DbTransactionExtensions
10 | {
11 | ///
12 | /// Execute a query asynchronously using .
13 | ///
14 | /// The transaction to query on.
15 | /// The SQL to execute for the query.
16 | /// The parameters to pass, if any.
17 | /// The transaction to use, if any.
18 | /// The command timeout (in seconds).
19 | /// The type of command to execute.
20 | ///
21 | /// A sequence of data of dynamic data
22 | ///
23 | public static IAsyncEnumerable QueryUnbufferedAsync(this DbTransaction @this, string sql, object? param = null, DbTransaction? transaction = null, int? commandTimeout = null, CommandType? commandType = null)
24 | {
25 | return InternalGetConnection.GetConnection(@this).QueryUnbufferedAsync(sql, param, transaction, commandTimeout, commandType);
26 | }
27 | }
28 | }
29 | #endif
--------------------------------------------------------------------------------
/Dapper.Transaction.Shared/DbTransaction/Extensions/Execute.cs:
--------------------------------------------------------------------------------
1 | using System.Data;
2 |
3 | namespace Dapper.Transaction
4 | {
5 | public static partial class DbTransactionExtensions
6 | {
7 | ///
8 | /// Execute parameterized SQL.
9 | ///
10 | /// The transaction to execute on.
11 | /// The command to execute on this connection.
12 | /// The number of rows affected.
13 | public static int Execute(this IDbTransaction transaction, CommandDefinition command)
14 | {
15 | return InternalGetConnection.GetConnection(transaction).Execute(command);
16 | }
17 |
18 | ///
19 | /// Execute parameterized SQL.
20 | ///
21 | /// The transaction to query on.
22 | /// The SQL to execute for this query.
23 | /// The parameters to use for this query.
24 | /// Number of seconds before command execution timeout.
25 | /// Is it a stored proc or a batch?
26 | /// The number of rows affected.
27 | public static int Execute(this IDbTransaction transaction, string sql, object param = null, int? commandTimeout = null, CommandType? commandType = null)
28 | {
29 | return InternalGetConnection.GetConnection(transaction).Execute(sql, param, transaction, commandTimeout, commandType);
30 | }
31 |
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Lab/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Lab")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Lab")]
13 | [assembly: AssemblyCopyright("Copyright © 2020")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("31a63124-67d2-4427-8cf9-73fc1521f638")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Dapper.Transaction.Shared/DbTransaction/Extensions/QueryMultiple.cs:
--------------------------------------------------------------------------------
1 | using System.Data;
2 |
3 | namespace Dapper.Transaction
4 | {
5 | public static partial class DbTransactionExtensions
6 | {
7 | ///
8 | /// Execute a command that returns multiple result sets, and access each in turn.
9 | ///
10 | /// The transaction to query on.
11 | /// The SQL to execute for this query.
12 | /// The parameters to use for this query.
13 | /// Number of seconds before command execution timeout.
14 | /// Is it a stored proc or a batch?
15 | public static SqlMapper.GridReader QueryMultiple(this IDbTransaction transaction, string sql, object param = null, int? commandTimeout = null, CommandType? commandType = null)
16 | {
17 | return InternalGetConnection.GetConnection(transaction).QueryMultiple(sql, param, transaction, commandTimeout, commandType);
18 | }
19 |
20 | ///
21 | /// Execute a command that returns multiple result sets, and access each in turn.
22 | ///
23 | /// The transaction to query on.
24 | /// The command to execute for this query.
25 | public static SqlMapper.GridReader QueryMultiple(this IDbTransaction transaction, CommandDefinition command)
26 | {
27 | return InternalGetConnection.GetConnection(transaction).QueryMultiple(command);
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/Lab.StrongName/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Lab.StrongName")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Lab.StrongName")]
13 | [assembly: AssemblyCopyright("Copyright © 2020")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("094c1b26-a616-4201-9858-b4a0dcbde883")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Dapper.Transaction.Shared/DbTransaction/Extensions/ExecuteScalar.cs:
--------------------------------------------------------------------------------
1 | using System.Data;
2 |
3 | namespace Dapper.Transaction
4 | {
5 | public static partial class DbTransactionExtensions
6 | {
7 | ///
8 | /// Execute parameterized SQL that selects a single value.
9 | ///
10 | /// The transaction to execute on.
11 | /// The SQL to execute.
12 | /// The parameters to use for this command.
13 | /// Number of seconds before command execution timeout.
14 | /// Is it a stored proc or a batch?
15 | /// The first cell selected as .
16 | public static object ExecuteScalar(this IDbTransaction transaction, string sql, object param = null, int? commandTimeout = null, CommandType? commandType = null)
17 | {
18 | return InternalGetConnection.GetConnection(transaction).ExecuteScalar(sql, param, transaction, commandTimeout, commandType);
19 | }
20 |
21 | ///
22 | /// Execute parameterized SQL that selects a single value.
23 | ///
24 | /// The transaction to execute on.
25 | /// The command to execute.
26 | /// The first cell selected as .
27 | public static object ExecuteScalar(this IDbTransaction transaction, CommandDefinition command)
28 | {
29 | return InternalGetConnection.GetConnection(transaction).ExecuteScalar(command);
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/Dapper.Transaction.Shared/DbTransaction/Extensions/ExecuteAsync.cs:
--------------------------------------------------------------------------------
1 | using System.Data;
2 | using System.Threading.Tasks;
3 |
4 | namespace Dapper.Transaction
5 | {
6 | public static partial class DbTransactionExtensions
7 | {
8 | ///
9 | /// Execute a command asynchronously using Task.
10 | ///
11 | /// The transaction to execute on.
12 | /// The command to execute on this connection.
13 | /// The number of rows affected.
14 | public static Task ExecuteAsync(this IDbTransaction transaction, CommandDefinition command)
15 | {
16 | return InternalGetConnection.GetConnection(transaction).ExecuteAsync(command);
17 | }
18 |
19 | ///
20 | /// Execute a command asynchronously using Task.
21 | ///
22 | /// The transaction to query on.
23 | /// The SQL to execute for this query.
24 | /// The parameters to use for this query.
25 | /// Number of seconds before command execution timeout.
26 | /// Is it a stored proc or a batch?
27 | /// The number of rows affected.
28 | public static Task ExecuteAsync(this IDbTransaction transaction, string sql, object param = null, int? commandTimeout = null, CommandType? commandType = null)
29 | {
30 | return InternalGetConnection.GetConnection(transaction).ExecuteAsync(sql, param, transaction, commandTimeout, commandType);
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Dapper.Transaction.Shared/DbTransaction/Extensions/QueryMultipleAsync.cs:
--------------------------------------------------------------------------------
1 | using System.Data;
2 | using System.Threading.Tasks;
3 |
4 | namespace Dapper.Transaction
5 | {
6 | public static partial class DbTransactionExtensions
7 | {
8 | ///
9 | /// Execute a command that returns multiple result sets, and access each in turn.
10 | ///
11 | /// The transaction to query on.
12 | /// The SQL to execute for this query.
13 | /// The parameters to use for this query.
14 | /// Number of seconds before command execution timeout.
15 | /// Is it a stored proc or a batch?
16 | public static Task QueryMultipleAsync(this IDbTransaction transaction, string sql, object param = null, int? commandTimeout = null, CommandType? commandType = null)
17 | {
18 | return InternalGetConnection.GetConnection(transaction).QueryMultipleAsync(sql, param, transaction, commandTimeout, commandType);
19 | }
20 |
21 | ///
22 | /// Execute a command that returns multiple result sets, and access each in turn.
23 | ///
24 | /// The transaction to query on.
25 | /// The command to execute for this query.
26 | public static Task QueryMultipleAsync(this IDbTransaction transaction, CommandDefinition command)
27 | {
28 | return InternalGetConnection.GetConnection(transaction).QueryMultipleAsync(command);
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/Dapper.Transaction.Shared/DbTransaction/Extensions/ExecuteScalarAsync.cs:
--------------------------------------------------------------------------------
1 | using System.Data;
2 | using System.Threading.Tasks;
3 |
4 | namespace Dapper.Transaction
5 | {
6 | public static partial class DbTransactionExtensions
7 | {
8 | ///
9 | /// Execute parameterized SQL that selects a single value.
10 | ///
11 | /// The transaction to execute on.
12 | /// The SQL to execute.
13 | /// The parameters to use for this command.
14 | /// Number of seconds before command execution timeout.
15 | /// Is it a stored proc or a batch?
16 | /// The first cell returned, as .
17 | public static Task