Skip to content

Commit

Permalink
minor data merge extension
Browse files Browse the repository at this point in the history
  • Loading branch information
pwelter34 committed Sep 19, 2024
1 parent c8c9b97 commit 91127d0
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/FluentCommand.SqlServer/Merge/DataMerge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ public IDataMerge Mode(DataMergeMode mergeMode)
}

/// <summary>
/// Sets the wait time before terminating the attempt to execute a command and generating an error.
/// Sets the wait time (in seconds) before terminating the attempt to execute the command and generating an error.
/// </summary>
/// <param name="timeout">TThe time in seconds to wait for the command to execute.</param>
/// <param name="timeout">The time in seconds to wait for the command to execute.</param>
/// A fluent <see langword="interface" /> to a <see cref="DataMerge " /> operation.
public IDataMerge CommandTimeout(int timeout)
{
Expand Down
19 changes: 19 additions & 0 deletions src/FluentCommand.SqlServer/Merge/DataMergeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,23 @@ public static IDataMerge MergeData(this IDataSession session, DataMergeDefinitio
{
return new DataMerge(session, mergeDefinition);
}


/// <summary>
/// Sets the wait time before terminating the attempt to execute a command and generating an error.
/// </summary>
/// <param name="dataMerge">The <see cref="IDataMerge"/> for this extension method.</param>
/// <param name="timeSpan">The <see cref="TimeSpan"/> to wait for the command to execute.</param>
/// <returns>
/// A fluent <see langword="interface" /> to the data command.
/// </returns>
public static IDataMerge CommandTimeout(
this IDataMerge dataMerge,
TimeSpan timeSpan)
{
var timeout = Convert.ToInt32(timeSpan.TotalSeconds);
dataMerge.CommandTimeout(timeout);
return dataMerge;
}

}
4 changes: 2 additions & 2 deletions src/FluentCommand.SqlServer/Merge/IDataMerge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ public interface IDataMerge
IDataMerge Mode(DataMergeMode mergeMode);

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

Expand Down
2 changes: 1 addition & 1 deletion src/FluentCommand/DataCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public IDataCommand StoredProcedure(string storedProcedure)


/// <summary>
/// Sets the wait time before terminating the attempt to execute a command and generating an error.
/// Sets the wait time (in seconds) before terminating the attempt to execute the command and generating an error.
/// </summary>
/// <param name="timeout">The time, in seconds, to wait for the command to execute.</param>
/// <returns>
Expand Down
4 changes: 2 additions & 2 deletions src/FluentCommand/IDataCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public interface IDataCommand : IDataQuery, IDataQueryAsync


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

Expand Down

0 comments on commit 91127d0

Please sign in to comment.