Skip to content

Commit 91127d0

Browse files
committed
minor data merge extension
1 parent c8c9b97 commit 91127d0

File tree

5 files changed

+26
-7
lines changed

5 files changed

+26
-7
lines changed

src/FluentCommand.SqlServer/Merge/DataMerge.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ public IDataMerge Mode(DataMergeMode mergeMode)
140140
}
141141

142142
/// <summary>
143-
/// Sets the wait time before terminating the attempt to execute a command and generating an error.
143+
/// Sets the wait time (in seconds) before terminating the attempt to execute the command and generating an error.
144144
/// </summary>
145-
/// <param name="timeout">TThe time in seconds to wait for the command to execute.</param>
145+
/// <param name="timeout">The time in seconds to wait for the command to execute.</param>
146146
/// A fluent <see langword="interface" /> to a <see cref="DataMerge " /> operation.
147147
public IDataMerge CommandTimeout(int timeout)
148148
{

src/FluentCommand.SqlServer/Merge/DataMergeExtensions.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,23 @@ public static IDataMerge MergeData(this IDataSession session, DataMergeDefinitio
4646
{
4747
return new DataMerge(session, mergeDefinition);
4848
}
49+
50+
51+
/// <summary>
52+
/// Sets the wait time before terminating the attempt to execute a command and generating an error.
53+
/// </summary>
54+
/// <param name="dataMerge">The <see cref="IDataMerge"/> for this extension method.</param>
55+
/// <param name="timeSpan">The <see cref="TimeSpan"/> to wait for the command to execute.</param>
56+
/// <returns>
57+
/// A fluent <see langword="interface" /> to the data command.
58+
/// </returns>
59+
public static IDataMerge CommandTimeout(
60+
this IDataMerge dataMerge,
61+
TimeSpan timeSpan)
62+
{
63+
var timeout = Convert.ToInt32(timeSpan.TotalSeconds);
64+
dataMerge.CommandTimeout(timeout);
65+
return dataMerge;
66+
}
67+
4968
}

src/FluentCommand.SqlServer/Merge/IDataMerge.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ public interface IDataMerge
8181
IDataMerge Mode(DataMergeMode mergeMode);
8282

8383
/// <summary>
84-
/// Sets the wait time before terminating the attempt to execute a command and generating an error.
84+
/// Sets the wait time (in seconds) before terminating the attempt to execute the command and generating an error.
8585
/// </summary>
86-
/// <param name="timeout">TThe time in seconds to wait for the command to execute.</param>
86+
/// <param name="timeout">The time in seconds to wait for the command to execute.</param>
8787
/// A fluent <see langword="interface" /> to a <see cref="DataMerge " /> operation.
8888
IDataMerge CommandTimeout(int timeout);
8989

src/FluentCommand/DataCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public IDataCommand StoredProcedure(string storedProcedure)
7070

7171

7272
/// <summary>
73-
/// Sets the wait time before terminating the attempt to execute a command and generating an error.
73+
/// Sets the wait time (in seconds) before terminating the attempt to execute the command and generating an error.
7474
/// </summary>
7575
/// <param name="timeout">The time, in seconds, to wait for the command to execute.</param>
7676
/// <returns>

src/FluentCommand/IDataCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public interface IDataCommand : IDataQuery, IDataQueryAsync
3434

3535

3636
/// <summary>
37-
/// Sets the wait time before terminating the attempt to execute a command and generating an error.
37+
/// Sets the wait time (in seconds) before terminating the attempt to execute the command and generating an error.
3838
/// </summary>
39-
/// <param name="timeout">TThe time in seconds to wait for the command to execute.</param>
39+
/// <param name="timeout">The time in seconds to wait for the command to execute.</param>
4040
/// <returns>A fluent <see langword="interface"/> to the data command.</returns>
4141
IDataCommand CommandTimeout(int timeout);
4242

0 commit comments

Comments
 (0)